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

时间:2022-09-03 19:59:17

I am running Visual Studio 2008, IIS 7.5 on Windows 7 x32. 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:

我在Windows 7 x32上运行Visual Studio 2008,IIS 7.5。我可以在IIS 7.5中运行ASP.NET网站而无需调试就好了,但是当我按F5进行调试时,我得到:

Unable to start debugging on the web server. 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服务器上启动调试。无法连接到网络服务器。验证Web服务器是否正在运行,并且防火墙未阻止传入的http请求。

6 个解决方案

#1


11  

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 Dev服务器,使用本地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)

从管理命令提示符运行“iisreset”(基本上只是重新启动IIS服务)

#2


6  

Check if your IIS is running, if isn't try to initialize him and run again on VS.

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

#3


2  

Try the following:

请尝试以下方法:

  1. Open IIS > Add a new Application (not a virtual folder) to the Default Website.
  2. 打开IIS>将新应用程序(不是虚拟文件夹)添加到默认网站。
  3. Make sure the application runs under the right .net framework version (i.e. DefaultAppPool ussually runs under .Net 4.0)
  4. 确保应用程序在正确的.net框架版本下运行(即DefaultAppPool通常在.Net 4.0下运行)
  5. Map the application in IIS to the right project folder (where your bin and obj folder appear after a build)
  6. 将IIS中的应用程序映射到正确的项目文件夹(构建后出现bin和obj文件夹)
  7. In IIS, right-click the application, and click 'Manage application' > 'Browse'. This will launch an internet exploreren to the right path. 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)
  8. 在IIS中,右键单击该应用程序,然后单击“管理应用程序”>“浏览”。这将推动互联网探索者走上正确的道路。这可能是localhost:80 / Shop而不是预期的localhost / Shop(例如由直接localhost /位置的其他应用程序的预留引起)
  9. 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)
  10. 在Visual Studio中>转到应用程序属性> Web>选中使用本地IIS>并在IIS中设置应用程序的正确位置(您应该从步骤4了解到这一点)

#4


0  

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" />

#5


0  

Just to check: See if Windows Authentication is enabled or not? It should be enabled. Internet Information Services (IIS) Manager > Expand PC/Server Name > Expand Sites > Select Default Web Site > Select Authentication. It should be enabled.

只是为了检查:看看是否启用了Windows身份验证?它应该启用。 Internet信息服务(IIS)管理器>展开PC /服务器名称>展开站点>选择默认网站>选择身份验证。它应该启用。

#6


0  

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.

我有这个问题,修复端口解决了我的问题。

#1


11  

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 Dev服务器,使用本地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)

从管理命令提示符运行“iisreset”(基本上只是重新启动IIS服务)

#2


6  

Check if your IIS is running, if isn't try to initialize him and run again on VS.

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

#3


2  

Try the following:

请尝试以下方法:

  1. Open IIS > Add a new Application (not a virtual folder) to the Default Website.
  2. 打开IIS>将新应用程序(不是虚拟文件夹)添加到默认网站。
  3. Make sure the application runs under the right .net framework version (i.e. DefaultAppPool ussually runs under .Net 4.0)
  4. 确保应用程序在正确的.net框架版本下运行(即DefaultAppPool通常在.Net 4.0下运行)
  5. Map the application in IIS to the right project folder (where your bin and obj folder appear after a build)
  6. 将IIS中的应用程序映射到正确的项目文件夹(构建后出现bin和obj文件夹)
  7. In IIS, right-click the application, and click 'Manage application' > 'Browse'. This will launch an internet exploreren to the right path. 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)
  8. 在IIS中,右键单击该应用程序,然后单击“管理应用程序”>“浏览”。这将推动互联网探索者走上正确的道路。这可能是localhost:80 / Shop而不是预期的localhost / Shop(例如由直接localhost /位置的其他应用程序的预留引起)
  9. 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)
  10. 在Visual Studio中>转到应用程序属性> Web>选中使用本地IIS>并在IIS中设置应用程序的正确位置(您应该从步骤4了解到这一点)

#4


0  

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" />

#5


0  

Just to check: See if Windows Authentication is enabled or not? It should be enabled. Internet Information Services (IIS) Manager > Expand PC/Server Name > Expand Sites > Select Default Web Site > Select Authentication. It should be enabled.

只是为了检查:看看是否启用了Windows身份验证?它应该启用。 Internet信息服务(IIS)管理器>展开PC /服务器名称>展开站点>选择默认网站>选择身份验证。它应该启用。

#6


0  

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.

我有这个问题,修复端口解决了我的问题。