程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> .NET實例教程 >> VS.NET調試.NET出現的常見錯誤

VS.NET調試.NET出現的常見錯誤

編輯:.NET實例教程

一、 調試 ASP.Net 應用程序時出現"未將項目配置為進行調試"的錯誤信息

症狀

當您在 Visual Studio .NET 中調試 ASP.Net 應用程序時,可能會出現下面的錯誤信息:

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?


原因


出現此錯誤主要是因為下列原因:

ASP.Net 應用程序沒有 Web.Config 文件。
"Internet 服務管理器"中當前項目文件夾的執行許可屬性設置為了無。


解決方案

若要解決此問題,請根據您的具體環境,使用以下方法之一:

如果您的項目沒有 Web.config 文件,則向包含該 ASP.NET 應用程序的目錄添加一個 Web.config 文件。如果您是在 Visual Studio .Net 中工作,則用右鍵單擊"項目資源管理器"中的項目,單擊添加新項,然後單擊 Web 配置文件。

如果您的項目已經有了 Web.config 文件,而且該 Web.config 文件的"編譯"部分中 debug 屬性設置為了 true ,則請按照下列步驟設置該項目文件夾的執行許可屬性:

1 啟動"Internet 服務管理器",然後單擊要嘗試進行調試的項目。
2 右鍵單擊該項目,然後單擊屬性。
3 單擊目錄選項卡。
4 如果在執行許可列表中選擇了無,則單擊"僅顯示腳本"然後單擊應用。



二、在發送調試 HTTP 請求時出現"無法啟動調試"的錯誤信息


症狀


當您在 Visual Studio .NET 中調試 ASP.Net 應用程序時,可能會出現下面的錯誤信息:

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 應用程序的 Web.config 文件中有語法錯誤,就會發生此問題。


解決方案
若要解決此問題,要確保 Web.config 文件中的可擴展標記語言 (XML) 有效且格式正確。

此外,還要記住 Web.config 中的一切字符都是區分大小寫的。


三、調試 ASP.Net 應用程序時出現"訪問被拒絕。請檢查計算機調試管理器的 DCOM 配置設置。"的錯誤信息


症狀


當您在 Visual Studio .NET 中遠程調試 ASP.Net 應用程序時,可能會出現下面的錯誤信息:

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?

原因


之所以會發生此錯誤是因為試圖進行遠程調試的用戶不是 Microsoft Internet Information Server (IIS) 服務器上"調試器用戶"組的成員。
解決方案
若要將適當的用戶添加到"調試器用戶"組中,請在 Web 服務器上按照下列步驟操作:
1 從 Windows 開始菜單中,指向程序,指向管理工具,然後單擊計算機管理。
2 在左窗格中,單擊以展開計算機管理,系統工具和本地用戶和組節點。
3 單擊組,然後雙擊調試器用戶。
4 在調試器用戶屬性對話框中,單擊添加。
5 在選擇用戶或組對話框中,選擇適當的用戶,然後單擊確定。
6 單擊確定退出調試器用戶屬性對話框。
7 關閉"計算機管理"資源管理器。 


四、調試 ASP.Net 應用程序時出現"無法在 Web 服務器上啟動調試"的錯誤信息


症狀


當您在 Visual Studio .NET 中調試 ASP.Net 應用程序時,可能會出現下面的錯誤信息:

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?


原因


之所以發生此錯誤是因為 Microsoft Internet Information Server (IIS) 未運行或者運行不正常。


解決方案


若要解決此問題,必須重新啟動 IIS。為此,請在命令提示符處鍵入 IISreset。 



五、調試 ASP.NET 頁時 Visual Studio .Net 調試器不在斷點停止


症狀


在 Visual Studio .NET 中調試 ASP.Net 應用程序時,調試器可能不在斷點處停止。

原因


之所以會發生此問題,是因為在應用程序中未啟用 ASP.Net 調試。


解決方案


若要解決此問題,請在 Visual Studio .Net 中按照下列步驟操作:
1 在"解決方案資源管理器"中,選擇項目名稱。
2 在項目菜單中,單擊屬性。
3 單擊以展開配置屬性節點。
4 在調試下的啟用 ASP.Net 調試列表中,單擊 True。 



六、無法調試 ASP.Net Web 應用程序

症狀


當您在 Microsoft Visual Studio .NET 中調試 ASP.Net 應用程序時,可能會顯示下面的 Microsoft 開發環境錯誤信息:

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 設置或安裝沒有正確完成,則可能發生此錯誤。發生此錯誤時,在 Microsoft Internet 信息服務 (IIS) 中不會正確配置 ASP.Net 文件擴展名(例如 .ASPx)的應用程序映射。

若要檢查應用程序映射是否正確,請按照下列步驟操作:
1 單擊開始,指向程序,指向管理工具,然後單擊 Internet 服務管理器。
2 展開對應於本地主機(計算機名)的節點,然後展開默認 Web 站點節點。
3 右鍵單擊 Web 應用程序目錄,然後單擊屬性。
4 在目錄選項卡上的應用程序設置下,單擊配置。
5 單擊應用程序映射選項卡。
6 在應用程序映射選項卡的應用程序映射下,檢查 .ASPx 擴展名是否映射到以下動態鏈接庫 (DLL):
C:\Windows Directory\Microsoft.Net\Framework\v1.0.3705\ASPnet_isapi.dll

備注:必須用您的系統的正確目錄替代此路徑中的 Windows Directory。

7 如果未找到應用程序映射條目,請遵循"解決辦法"一節中的步驟執行。


解決方案


若要解決此問題,請使用 Aspnet_regIIS.exe 管理實用工具,該實用工具在單個計算機上管理多個版本的 ASP.Net 的安裝和卸載。

若要使用 ASPnet_regIIS.exe 實用工具,請遵循以下步驟:
1 單擊開始,然後單擊運行。
2 在打開框中鍵入 cmd,然後單擊確定以打開命令提示。
3 在命令提示處,鍵入 cd 命令以更改為以下目錄:
C:\Windows Directory\Microsoft.Net\Framework\v1.0.3705

4 鍵入 ASPnet_regIIS -i 以正確配置所需的應用程序映射。 

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?

請驗證您是計算機上"管理員"組和"調試器用戶"組的成員。非管理員不具有調試 ASP.Net 輔助進程 (ASPnet_wp.exe) 的正確權限。 


 


文章來源:西部E網 cpro_clIEnt=''westecpr'';cpro_cbd=''#trans''; cpro_cbg=''#trans''; cpro_ctitle=''#0000ff''; cpro_clink=''#trans''; cpro_w=200; cpro_h=90; cpro_template=''wlink_default_200_90'';
 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved