Cannot run web application on Windows 10 using IIS Express

青春壹個敷衍的年華 提交于 2020-03-17 05:37:20

问题


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).

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.

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?

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.


回答1:


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).




回答2:


(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
  • Installing IIS Express 8
  • Deleting 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.

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.

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




回答3:


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.

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

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\

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




回答4:


I got the same issue as DJH2006X.

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




回答5:


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...)




回答6:


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.



来源:https://stackoverflow.com/questions/31959548/cannot-run-web-application-on-windows-10-using-iis-express

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!