现在的位置: 首页 > 综合 > 正文

VS.NET调试.NET出现的常见错误 (转载)

2012年02月17日 ⁄ 综合 ⁄ 共 7978字 ⁄ 字号 评论关闭
       

一、 调试 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) 的正确权限。 


日期: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

抱歉!评论已关闭.