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

來源:互聯網
上載者:User
       

一、 調試 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 檔案。
"網際網路服務管理員"中當前專案檔夾的執行許可屬性設定為了無。

解決方案

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

如果您的項目沒有 Web.config 檔案,則向包含該 ASP.NET 應用程式的目錄添加一個 Web.config 檔案。如果您是在 Visual Studio .NET 中工作,則用按右鍵"項目資源管理員"中的項目,單擊添加新項,然後單擊 Web 設定檔。

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

1 啟動"網際網路服務管理員",然後單擊要嘗試進行調試的項目。
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) (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 單擊開始,指向程式,指向管理工具,然後單擊 網際網路服務管理員。
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) 的正確許可權。 

日期:2004-6-20 15:54:37 來源:weste
 

     補充:
     

Introduction

During the last several months, I have dealt with many users from both inside and outside of Microsoft who have debugging issues. I noticed that there are many common mistakes and problems that can be solved, if users are provided with proper diagnosis. Hence, I’ve written this document to provide you with this information which will help you if you run into any issues while using the debugger.

This document contains:

  • Error message dialog or description of error situation
  • The causes for error
  • How to fix the problem.

And I especially thanks to VCS debugger team and other people who helped me to complete this document with various feed back.

Debugging issues

ASP.NET Debugging

            *If you can’t find the error message that you’re looking for in this section, please check the section which deals with general debugging issues or remote debugging issues.

 

Message: Unable to start debugging on the web server

Your IIS application of IIS is not configured to use “integrated Windows authentication”. Please make sure that the “integrated windows authentication” checkbox on the “authentication method” dialog box is checked.

Message: You do not have permission to debug the server

 

  • Cause 1: Make sure that “Integrated Windows Authentication” is enabled. Probably, you enabled only “Basic authentication” for Directory security of IIS. 

  • Cause 2: If you are using “Integrated Windows authentication”, you need to make sure that your user account has full control on the directory of the IIS.
  • Cause 3: If you created the web project with a full machine name (like “machinename.domainname.something”), the web site is recognized as “Internet” site. So the default setting of IE will impact on the behavior of log on. In this case, you need to enable logging on with your current user account in “Internet” area with IE setting.

    But it is not the default setting of IE, so you’d be better off if you create project with only the machine name.

Message: Server side-error occurred on sending debug HTTP request.

 

Cause 1: Your web application doesn’t have an Application name. Please check the properties of the web project using the IIS MMC to ensure that your web project has an application name

You need to create an application name for debugging.

Cause 2: If you are using the NTFS file format, please make sure that “aspnet” has proper privilege on “wwwroot” or your folder for virtual directory to access and write on the folders.

Message: The project is not configured to be debugged.

 

You need to make sure that your web is configured for debugging. To do this, you need set “debug = true” in the “web.config” file. You may find this file in your web project folder.

Can start debugging without error message, but breakpoints are not hit.

You started debugging with “F5” and it looks like debugging is started properly, and IE is launched properly. But you can’t hit a breakpoint on my code behind code.

 

Cause 1: Please make sure that “asp.net debugging” is enabled in the properties of project.

In the case of VB project, the UI is different. But you can recognize the equivalent one easily.

Cause 2: Please make sure that the expected DLL is loaded with matched debug symbol file. You can check it with “Modules” window.

Message: The debugger is not properly installed.

 

If you see this problem, please check debugging with console application project. And if the console application project shows the error message like

It means that your .Net framework is not installed properly. So you need to register “mscordbi.dll” manually by executing “regsvr32 mscordbi.dll”.  

Message : The server does not support debugging of ASP.NET or ATL server applications.

 

If you have an XP Pro or W2K Pro machine, you may need to think about the order of installation between VS7 and IIS. If you install IIS after VS7, you will get this error. In this case, please register “aspnet_isapi.dll” with “aspnet_regiis.exe –i”.

Message: Access is denied. Verify that you are an administrator or a member of …

 

You may not be the member of “Debugger users” group on the machine. Please add your user account into “Debugger users” group on the machine.

To add your user account into “Debugger users” group, you need to do the following:

1.      Log in as “Administrator”

2.      Run  “Computer management” in “Administrator tools”

3.      Choose “Local users and groups"groups” node

4.      Double-click “Debugger users” group on right pane.

Error while trying to run project: Unable to start debugging on the web
server. The project is not configured to be debugged.

IIRC this is due the folder in the IIS webserver is not configured as an
APP

go to IIS , right click the dir and select create app

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.