一、 調(diào)試 ASP.NET 應(yīng)用程序時(shí)出現(xiàn)"未將項(xiàng)目配置為進(jìn)行調(diào)試"的錯(cuò)誤信息
癥狀
當(dāng)您在 Visual Studio .NET 中調(diào)試 ASP.NET 應(yīng)用程序時(shí),可能會(huì)出現(xiàn)下面的錯(cuò)誤信息:
Error while trying to run project: Unable to start debugging on the web server. The project is not configured to be debugged
For ASP.NET projects, verify that you have a valid project file called 'Web.config' for the URL specified and 'debug' is set to 'true' in that file.
For ATL Server projects, verify that the 'DEBUG' verb is associated with your ISAPI extension.
Would you like to disable future attempts to debug ASP.NET pages for this project?
原因
出現(xiàn)此錯(cuò)誤主要是因?yàn)橄铝性颍?BR>
ASP.NET 應(yīng)用程序沒(méi)有 Web.Config 文件。
"Internet 服務(wù)管理器"中當(dāng)前項(xiàng)目文件夾的執(zhí)行許可屬性設(shè)置為了無(wú)。
解決方案
若要解決此問(wèn)題,請(qǐng)根據(jù)您的具體環(huán)境,使用以下方法之一:
如果您的項(xiàng)目沒(méi)有 Web.config 文件,則向包含該 ASP.NET 應(yīng)用程序的目錄添加一個(gè) Web.config 文件。如果您是在 Visual Studio .NET 中工作,則用右鍵單擊"項(xiàng)目資源管理器"中的項(xiàng)目,單擊添加新項(xiàng),然后單擊 Web 配置文件。
如果您的項(xiàng)目已經(jīng)有了 Web.config 文件,而且該 Web.config 文件的"編譯"部分中 debug 屬性設(shè)置為了 true ,則請(qǐng)按照下列步驟設(shè)置該項(xiàng)目文件夾的執(zhí)行許可屬性:
1 啟動(dòng)"Internet 服務(wù)管理器",然后單擊要嘗試進(jìn)行調(diào)試的項(xiàng)目。
2 右鍵單擊該項(xiàng)目,然后單擊屬性。
3 單擊目錄選項(xiàng)卡。
4 如果在執(zhí)行許可列表中選擇了無(wú),則單擊"僅顯示腳本"然后單擊應(yīng)用。
二、在發(fā)送調(diào)試 HTTP 請(qǐng)求時(shí)出現(xiàn)"無(wú)法啟動(dòng)調(diào)試"的錯(cuò)誤信息
癥狀
當(dāng)您在 Visual Studio .NET 中調(diào)試 ASP.NET 應(yīng)用程序時(shí),可能會(huì)出現(xiàn)下面的錯(cuò)誤信息:
Error while trying to run project:Unable to start debugging on the web server.Server-side error occurred on sending debug HTTP request.
Make sure the server is operating correctly.Make sure the server is operating correctly.You may also want to refer to the ASP.NET and ATL Server debugging topic in the online documentation.Would you like to disable future attempts to debug ASP.NET pages for this project?
原因
如果 ASP.NET 應(yīng)用程序的 Web.config 文件中有語(yǔ)法錯(cuò)誤,就會(huì)發(fā)生此問(wèn)題。
解決方案
若要解決此問(wèn)題,要確保 Web.config 文件中的可擴(kuò)展標(biāo)記語(yǔ)言 (XML) 有效且格式正確。此外,還要記住 Web.config 中的一切字符都是區(qū)分大小寫(xiě)的。
三、調(diào)試 ASP.NET 應(yīng)用程序時(shí)出現(xiàn)"訪(fǎng)問(wèn)被拒絕。請(qǐng)檢查計(jì)算機(jī)調(diào)試管理器的 DCOM 配置設(shè)置。"的錯(cuò)誤信息
癥狀
當(dāng)您在 Visual Studio .NET 中遠(yuǎn)程調(diào)試 ASP.NET 應(yīng)用程序時(shí),可能會(huì)出現(xiàn)下面的錯(cuò)誤信息:
Error while trying to run project:Unable to start debugging on the web server.Access is denied.Check the DCOM configuration settings for the machine debug manager.Would you like to disable future attempts to debug ASP.NET pages for this project?
原因
之所以會(huì)發(fā)生此錯(cuò)誤是因?yàn)樵噲D進(jìn)行遠(yuǎn)程調(diào)試的用戶(hù)不是 Microsoft Internet Information Server (IIS) 服務(wù)器上"調(diào)試器用戶(hù)"組的成員。
解決方案
若要將適當(dāng)?shù)挠脩?hù)添加到"調(diào)試器用戶(hù)"組中,請(qǐng)?jiān)?Web 服務(wù)器上按照下列步驟操作:
1 從 Windows 開(kāi)始菜單中,指向程序,指向管理工具,然后單擊計(jì)算機(jī)管理。
2 在左窗格中,單擊以展開(kāi)計(jì)算機(jī)管理,系統(tǒng)工具和本地用戶(hù)和組節(jié)點(diǎn)。
3 單擊組,然后雙擊調(diào)試器用戶(hù)。
4 在調(diào)試器用戶(hù)屬性對(duì)話(huà)框中,單擊添加。
5 在選擇用戶(hù)或組對(duì)話(huà)框中,選擇適當(dāng)?shù)挠脩?hù),然后單擊確定。
6 單擊確定退出調(diào)試器用戶(hù)屬性對(duì)話(huà)框。
7 關(guān)閉"計(jì)算機(jī)管理"資源管理器。
四、調(diào)試 ASP.NET 應(yīng)用程序時(shí)出現(xiàn)"無(wú)法在 Web 服務(wù)器上啟動(dòng)調(diào)試"的錯(cuò)誤信息
癥狀
當(dāng)您在 Visual Studio .NET 中調(diào)試 ASP.NET 應(yīng)用程序時(shí),可能會(huì)出現(xiàn)下面的錯(cuò)誤信息:
Error while trying to run project:Unable to start debugging on the web server.Would you like to disable future attempts to debug ASP.NET pages for this project?
原因
之所以發(fā)生此錯(cuò)誤是因?yàn)?Microsoft Internet Information Server (IIS) 未運(yùn)行或者運(yùn)行不正常。
解決方案
若要解決此問(wèn)題,必須重新啟動(dòng) IIS。為此,請(qǐng)?jiān)诿钐崾痉庢I入 iisreset。
五、調(diào)試 ASP.NET 頁(yè)時(shí) Visual Studio .NET 調(diào)試器不在斷點(diǎn)停止
癥狀
在 Visual Studio .NET 中調(diào)試 ASP.NET 應(yīng)用程序時(shí),調(diào)試器可能不在斷點(diǎn)處停止。
原因
之所以會(huì)發(fā)生此問(wèn)題,是因?yàn)樵趹?yīng)用程序中未啟用 ASP.NET 調(diào)試。
解決方案
若要解決此問(wèn)題,請(qǐng)?jiān)?Visual Studio .NET 中按照下列步驟操作:
1 在"解決方案資源管理器"中,選擇項(xiàng)目名稱(chēng)。
2 在項(xiàng)目菜單中,單擊屬性。
3 單擊以展開(kāi)配置屬性節(jié)點(diǎn)。
4 在調(diào)試下的啟用 ASP.NET 調(diào)試列表中,單擊 True。
六、無(wú)法調(diào)試 ASP.NET Web 應(yīng)用程序
癥狀
當(dāng)您在 Microsoft Visual Studio .NET 中調(diào)試 ASP.NET 應(yīng)用程序時(shí),可能會(huì)顯示下面的 Microsoft 開(kāi)發(fā)環(huán)境錯(cuò)誤信息:
Error while trying to run project:Unable to start debugging on the web server.The server does not support debugging of ASP.NET or ATL Server applications.Run setup to install the Visual Studio .NET server components.If setup has been run, verify that a valid URL has been specified.
You may also want to refer to the ASP.NET and ATL Server debugging topic in the online documentation.Would you like to disable future attempts to debug ASP.NET pages for this project?
原因
如果 Microsoft .NET Framework 設(shè)置或安裝沒(méi)有正確完成,則可能發(fā)生此錯(cuò)誤。發(fā)生此錯(cuò)誤時(shí),在 Microsoft Internet 信息服務(wù) (IIS) 中不會(huì)正確配置 ASP.NET 文件擴(kuò)展名(例如 .aspx)的應(yīng)用程序映射。
若要檢查應(yīng)用程序映射是否正確,請(qǐng)按照下列步驟操作:
1 單擊開(kāi)始,指向程序,指向管理工具,然后單擊 Internet 服務(wù)管理器。
2 展開(kāi)對(duì)應(yīng)于本地主機(jī)(計(jì)算機(jī)名)的節(jié)點(diǎn),然后展開(kāi)默認(rèn) Web 站點(diǎn)節(jié)點(diǎn)。
3 右鍵單擊 Web 應(yīng)用程序目錄,然后單擊屬性。
4 在目錄選項(xiàng)卡上的應(yīng)用程序設(shè)置下,單擊配置。
5 單擊應(yīng)用程序映射選項(xiàng)卡。
6 在應(yīng)用程序映射選項(xiàng)卡的應(yīng)用程序映射下,檢查 .aspx 擴(kuò)展名是否映射到以下動(dòng)態(tài)鏈接庫(kù) (DLL):
C:\Windows Directory\Microsoft.Net\Framework\v1.0.3705\aspnet_isapi.dll
備注:必須用您的系統(tǒng)的正確目錄替代此路徑中的 Windows Directory。
7 如果未找到應(yīng)用程序映射條目,請(qǐng)遵循"解決辦法"一節(jié)中的步驟執(zhí)行。
解決方案
若要解決此問(wèn)題,請(qǐng)使用 Aspnet_regiis.exe 管理實(shí)用工具,該實(shí)用工具在單個(gè)計(jì)算機(jī)上管理多個(gè)版本的 ASP.NET 的安裝和卸載。
若要使用 Aspnet_regiis.exe 實(shí)用工具,請(qǐng)遵循以下步驟:
1 單擊開(kāi)始,然后單擊運(yùn)行。
2 在打開(kāi)框中鍵入 cmd,然后單擊確定以打開(kāi)命令提示。
3 在命令提示處,鍵入 cd 命令以更改為以下目錄:
C:\Windows Directory\Microsoft.Net\Framework\v1.0.3705
4 鍵入 aspnet_regiis -i 以正確配置所需的應(yīng)用程序映射。
Error while trying to run project:Unable to start debugging on the web server.Access is denied.Would you like to disable future attempts to debug ASP.NET pages for this project?
請(qǐng)驗(yàn)證您是計(jì)算機(jī)上"管理員"組和"調(diào)試器用戶(hù)"組的成員。非管理員不具有調(diào)試 ASP.NET 輔助進(jìn)程 (Aspnet_wp.exe) 的正確權(quán)限。