无法使用IIS Express在Windows 10上运行web应用程序

时间:2022-06-05 07:26:06

I am developing a web application using ASP.NET MVC (a rather simple application, having just a single controller and a few routes; there´s nothing fancy in it). In the beginning I used Visual Studio 2013 and Windows 8/8.1. A couple of days ago I switched to Windows 10 and I am having trouble to run the application on my local development machine (I have both Visual Studio 2013 and 2015 installed, but I continue using Visual Studio 2013 for this project).

我正在开发一个使用ASP的web应用程序。NET MVC(一个相当简单的应用程序,只有一个控制器和几个路由;´s没有花哨的)。一开始我使用的是Visual Studio 2013和Windows 8/8.1。几天前,我切换到Windows 10,在本地开发机器上运行这个应用程序时遇到了麻烦(我安装了Visual Studio 2013和2015,但在这个项目中,我继续使用Visual Studio 2013)。

When I start a new instance for debugging, IIS Express starts, Visual Studio launches the selected browser (which is Edge by default), but the request to the site never returns a valid response.

当我启动一个新实例进行调试时,IIS Express启动,Visual Studio启动所选的浏览器(默认为Edge),但是对站点的请求永远不会返回有效的响应。

I can see in the system tray, that the application seems to be running fine. I also checked with Fiddler; and Fiddler shows me that the browser´s request never gets a response from the local server. Can this be an issue with the firewall?

我可以在系统托盘中看到,应用程序似乎运行良好。我也和Fiddler核对过;和浏览器显示我的提琴手´s从本地服务器请求从来没有得到响应。这是防火墙的问题吗?

Update

更新

I think it has nothing to do with the Edge-browser nor with the localhost loopback setting (this setting has been enabled via about:flags page). Furthermore, I experience this problem under the final version of Windows 10.

我认为它与边浏览器和localhost环回设置没有关系(这个设置是通过about:flags页面启用的)。此外,我在Windows 10的最终版本中遇到了这个问题。

6 个解决方案

#1


12  

I got it working for me, uninstall IIS Express 10.0 from 'Programs and Features' and install IIS Express 8.0. I have no idea what caused the issue in v10.0 as it works on some of my office machines and not on others (all Windows 10 x64).

我让它为我工作,从“程序和特性”卸载IIS Express 10.0,安装IIS Express 8.0。我不知道是什么原因导致了v10.0的问题,因为它适用于我的一些办公机器,而不适用于其他机器(所有的Windows 10 x64)。

#2


6  

(To moderators: please take the time to actually read my answer. It is not a 'thank you' post. It expands a hint that didn't work 'as-is' into a full solution)

(致主持人:请花点时间阅读我的答案。这不是一个“谢谢”的帖子。它将一个没有“按原样”工作的提示扩展为一个完整的解决方案)

Solved it. First I tried:

解决它。首先我尝试:

  • Reinstalling IIS Express 10
  • 重新安装IIS Express 10
  • Installing IIS Express 8
  • 安装IIS Express 8
  • Deleting applicationhost.config
  • 删除applicationhost.config

Nothing helped. I started IIS Express 10 via the command line and it worked fine. But Visual studio wouldn't launch my project.

没有什么帮助。我通过命令行启动了IIS Express 10,它运行良好。但是Visual studio不会启动我的项目。

Then I realized that my project settings survived several Windows reinstalls and migration from Windows 8 to Windows 10. So I deleted the entire .vs solution folder. Voila! The ASP.NET MVC web application is running in IIS Express 10.

然后我意识到,我的项目设置在Windows 8到Windows 10的几个Windows重新安装和迁移中幸存了下来。所以我删除了整个。vs解决方案文件夹。瞧!ASP。NET MVC web应用程序正在IIS Express 10中运行。

Credits go to @Bron Davies for mentioning the .vs folder. Going down this path led me to a full solution.

感谢@Bron的文件夹。沿着这条路走下去,我找到了一个完整的解决方案。

#3


4  

Try deleting your applicationhost.config file in %USERPROFILE%\Documents\IISExpress\config - this file can be problematic after an upgrade from Windows 7/8. When you start your project again, it will be recreated.

试着删除你applicationhost。设置文件在%USERPROFILE%\ document %\ IISExpress\config -这个文件可能在从Windows 7/8升级后出现问题。当您再次启动项目时,它将被重新创建。

How can I create new applicationhost.config file in IIS Express Server?

如何创建新的applicationhost。IIS Express服务器中的配置文件?

Also, make sure you are using IIS Express 8 for VS 2013. VS 2015 uses IIS Express 10 which has a different config file location per solution located in .vs\config\

此外,确保您正在使用IIS Express 8用于VS 2013。VS 2015使用IIS Express 10,每个解决方案都有不同的配置文件位置位于.vs\配置\中

Just as an aside, I highly recommend updating to VS 2015 if developing on Windows 10. The projects are still backward compatible if you have to switch back or collaborate with someone using 2013

顺便说一句,如果在Windows 10上开发,我强烈建议升级到VS 2015。如果您需要切换到2013年或者与使用2013年的人合作,那么这些项目仍然是向后兼容的

#4


1  

I got the same issue as DJH2006X.

我得到了和DJH2006X相同的问题。

I had to install IIS Express 8 instead of 10 and it works fine.

我必须安装IIS Express 8而不是10,它运行良好。

#5


0  

I just solved this problem... for some reason, win 10 was detecting my network connection as public... after setting it to private, and restarting IIS express everything worked fine... no need to run scripts or anything... (FYI, I had disabled win firewall ages ago...)

我刚刚解决了这个问题……出于某种原因,win 10检测到我的网络连接是公共的……将其设置为私有后,重新启动IIS表示一切正常。不需要运行脚本或任何东西…(顺便说一句,我很久以前就禁用了win防火墙……)

#6


0  

First thing is to delete applicationhost.config from the project folder ( as described above) and restart the visual studio. this will work for most of the scenarios.

首先要删除applicationhost。从项目文件夹中配置(如上所述)并重新启动visual studio。这将适用于大多数场景。

#1


12  

I got it working for me, uninstall IIS Express 10.0 from 'Programs and Features' and install IIS Express 8.0. I have no idea what caused the issue in v10.0 as it works on some of my office machines and not on others (all Windows 10 x64).

我让它为我工作,从“程序和特性”卸载IIS Express 10.0,安装IIS Express 8.0。我不知道是什么原因导致了v10.0的问题,因为它适用于我的一些办公机器,而不适用于其他机器(所有的Windows 10 x64)。

#2


6  

(To moderators: please take the time to actually read my answer. It is not a 'thank you' post. It expands a hint that didn't work 'as-is' into a full solution)

(致主持人:请花点时间阅读我的答案。这不是一个“谢谢”的帖子。它将一个没有“按原样”工作的提示扩展为一个完整的解决方案)

Solved it. First I tried:

解决它。首先我尝试:

  • Reinstalling IIS Express 10
  • 重新安装IIS Express 10
  • Installing IIS Express 8
  • 安装IIS Express 8
  • Deleting applicationhost.config
  • 删除applicationhost.config

Nothing helped. I started IIS Express 10 via the command line and it worked fine. But Visual studio wouldn't launch my project.

没有什么帮助。我通过命令行启动了IIS Express 10,它运行良好。但是Visual studio不会启动我的项目。

Then I realized that my project settings survived several Windows reinstalls and migration from Windows 8 to Windows 10. So I deleted the entire .vs solution folder. Voila! The ASP.NET MVC web application is running in IIS Express 10.

然后我意识到,我的项目设置在Windows 8到Windows 10的几个Windows重新安装和迁移中幸存了下来。所以我删除了整个。vs解决方案文件夹。瞧!ASP。NET MVC web应用程序正在IIS Express 10中运行。

Credits go to @Bron Davies for mentioning the .vs folder. Going down this path led me to a full solution.

感谢@Bron的文件夹。沿着这条路走下去,我找到了一个完整的解决方案。

#3


4  

Try deleting your applicationhost.config file in %USERPROFILE%\Documents\IISExpress\config - this file can be problematic after an upgrade from Windows 7/8. When you start your project again, it will be recreated.

试着删除你applicationhost。设置文件在%USERPROFILE%\ document %\ IISExpress\config -这个文件可能在从Windows 7/8升级后出现问题。当您再次启动项目时,它将被重新创建。

How can I create new applicationhost.config file in IIS Express Server?

如何创建新的applicationhost。IIS Express服务器中的配置文件?

Also, make sure you are using IIS Express 8 for VS 2013. VS 2015 uses IIS Express 10 which has a different config file location per solution located in .vs\config\

此外,确保您正在使用IIS Express 8用于VS 2013。VS 2015使用IIS Express 10,每个解决方案都有不同的配置文件位置位于.vs\配置\中

Just as an aside, I highly recommend updating to VS 2015 if developing on Windows 10. The projects are still backward compatible if you have to switch back or collaborate with someone using 2013

顺便说一句,如果在Windows 10上开发,我强烈建议升级到VS 2015。如果您需要切换到2013年或者与使用2013年的人合作,那么这些项目仍然是向后兼容的

#4


1  

I got the same issue as DJH2006X.

我得到了和DJH2006X相同的问题。

I had to install IIS Express 8 instead of 10 and it works fine.

我必须安装IIS Express 8而不是10,它运行良好。

#5


0  

I just solved this problem... for some reason, win 10 was detecting my network connection as public... after setting it to private, and restarting IIS express everything worked fine... no need to run scripts or anything... (FYI, I had disabled win firewall ages ago...)

我刚刚解决了这个问题……出于某种原因,win 10检测到我的网络连接是公共的……将其设置为私有后,重新启动IIS表示一切正常。不需要运行脚本或任何东西…(顺便说一句,我很久以前就禁用了win防火墙……)

#6


0  

First thing is to delete applicationhost.config from the project folder ( as described above) and restart the visual studio. this will work for most of the scenarios.

首先要删除applicationhost。从项目文件夹中配置(如上所述)并重新启动visual studio。这将适用于大多数场景。