简体   繁体   English

无法在 Web 服务器上开始调试。 无法连接到网络服务器

[英]Unable to start debugging on the web server. Unable to connect to the webserver

I am running Visual Studio 2008, IIS 7.5 on Windows 7 x32.我在 Windows 7 x32 上运行 Visual Studio 2008、IIS 7.5。 I am able to run the ASP.NET web site in IIS 7.5 without debugging just fine, but when I press F5 to debug it, I get:我无需调试即可在 IIS 7.5 中运行 ASP.NET 网站,但是当我按 F5 进行调试时,我得到:

Unable to start debugging on the web server.无法在 Web 服务器上开始调试。 Unable to connect to the webserver.无法连接到网络服务器。 Verify that the web server is running and that incoming http requests are not blocked by a firewall..验证 Web 服务器正在运行并且传入的 http 请求没有被防火墙阻止。

In VS , right click on your web project --> Properties Go to the Web tab.VS ,右键单击您的 Web 项目 --> 属性 转到 Web 选项卡。

Make sure the appropriate radio button is selected (Use VS Dev Server, Use Local IIS Web Server, etc)确保选择了适当的单选按钮(使用 VS 开发服务器、使用本地 IIS Web 服务器等)

After a computer freeze I've had that value change on me.电脑死机后,我的价值发生了变化。

Another thing to try:另一件事要尝试:

run " iisreset " from an administrative command prompt (basically just restarts the IIS service)administrative命令提示符运行“ iisreset ”(基本上只是重新启动 IIS 服务)

检查您的 IIS 是否正在运行,如果没有尝试初始化他并在 VS 上再次运行。

Try the following:请尝试以下操作:

  1. Open IIS > Add a new Application (not a virtual folder) to the Default Website.打开 IIS > 将新应用程序(不是虚拟文件夹)添加到默认网站。
  2. Make sure the application runs under the right .net framework version (ie DefaultAppPool ussually runs under .Net 4.0)确保应用程序在正确的 .net 框架版本下运行(即 DefaultAppPool 通常在 .Net 4.0 下运行)
  3. Map the application in IIS to the right project folder (where your bin and obj folder appear after a build)将 IIS 中的应用程序映射到正确的项目文件夹(您的 bin 和 obj 文件夹在构建后出现)
  4. In IIS, right-click the application, and click 'Manage application' > 'Browse'.在 IIS 中,右键单击应用程序,然后单击“管理应用程序”>“浏览”。 This will launch an internet exploreren to the right path.这将启动 Internet exploreren 到正确的路径。 This could be localhost:80/Shop instead of the expected localhost/Shop (caused by for example a reservation for other applications of the direct localhost/ location)这可能是 localhost:80/Shop 而不是预期的 localhost/Shop(例如,由直接 localhost/ 位置的其他应用程序的保留引起)
  5. In Visual Studio > go to the application properties > Web > check Use local IIS > and set the correct location of your application in IIS (you should know this from step 4)在 Visual Studio 中 > 转到应用程序属性 > Web > 选中使用本地 IIS > 并在 IIS 中设置应用程序的正确位置(您应该从步骤 4 中了解这一点)

Verify that your web.config has the following entry:验证您的web.config是否包含以下条目:

<compilation debug="true" targetFramework="2.0" />

Note: If you are targeting framework 1.1, then obviously change the 2.0 to 1.1 .注意:如果您的目标是框架 1.1,那么显然将2.0更改为1.1

UPDATE:更新:

The `targetFramework` attribute is new in .NET 4.0 and later, so to enable debugging on .NET 2.0 and earlier, then you cannot use the `targetFramework` attribute, like this:

<compilation debug="true" />

Just to check: See if Windows Authentication is enabled or not?只是为了检查:查看是否启用了 Windows 身份验证? It should be enabled.它应该被启用。 Internet Information Services (IIS) Manager > Expand PC/Server Name > Expand Sites > Select Default Web Site > Select Authentication. Internet 信息服务 (IIS) 管理器 > 展开 PC/服务器名称 > 展开站点 > 选择默认网站 > 选择身份验证。 It should be enabled.它应该被启用。

Make sure that the port defined in the Project Url under the Web tab of the properties of the web project is the same one as defined in the IIS Manager.确保在 Web 项目属性的 Web 选项卡下的项目 URL 中定义的端口与 IIS 管理器中定义的端口相同。

I had this issue and fixing the port solved the problem for me.我遇到了这个问题,修复端口为我解决了这个问题。

I had a case, where I could load the site in chrome, but deugger could contact the server.我有一个案例,我可以在 chrome 中加载网站,但 deugger 可以联系服务器。 Turns out Chrome auto-maps .localhost addresses, but VS does not.原来 Chrome 会自动映射 .localhost 地址,但 VS 不会。

Adding the localhost address to my hosts file solved the issue.将本地主机地址添加到我的主机文件解决了这个问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在Web服务器上启动调试。 - Unable to start debugging on the web server. 无法在Web服务器上启动调试。 操作超时 - Unable to start debugging on the web server. The operation timed out 无法在Web服务器上启动调试。 该地址对此上下文无效 - Unable to start debugging on the web server. The address is not valid for this context 无法在Web服务器上启动调试。 Visual Studio没有管理员 - Unable to start debugging on the web server. Visual Studio WITHOUT admin 无法在Web服务器上开始调试。 Visual Studio 2008年 - Unable to start debugging on the Web Server. Visual Studio 2008 无法在Web服务器上启动调试。 无法启动Asp.Net调试 - Unable to start debugging on the web server. Could not start Asp.Net debugging 无法在 WebServer 上开始调试 - Unable to Start Debugging on the WebServer 无法在Web服务器上启动调试。 Windows 64位平台不支持混合模式调试 - Unable to start debugging on the web server. Mixed mode debugging is not supported on Windows 64-bit platforms Visual Studio“无法在 Web 服务器上开始调试。Web 服务器没有及时响应。” - Visual Studio "Unable to start debugging on the web server. The web server did not respond in a timely manner." VS 2015错误无法在Web服务器上启动调试。 远程服务器返回错误:(403)禁止 - VS 2015 Error unable to start debugging on the web server. remote server returned an error:(403) forbidden
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM