Working with Visual Studio on recent Windows versions such as Windows 10 can be tricky, as the improved security settings of the new OS might create some issues on a developer machine, which often need to have access to some system files – expecially when working with IIS Express. We talked about that in a number of post, for example here (error accessing IIS Metabase), here (allow external requests from remote machines) and also here (Process with an ID #### error).
Here we’ll introduce another issue you might stumble upon while working with an ASP.NET Core or MVC solution, right after you try to execute it in debug mode:
Unable to launch the IIS Express Web server
There are many workaround that might fix this issue: we suggest to try them one after another, stopping only when you manage to fix it.
- Delete the \Documents\IISExpress folder using the following console command: rmdir /s /q "%userprofile%\Documents\IISExpress"
- Delete the applicationhost.config file which is placed within the \.vs\Config\ folder in your Visual Studio project root folder.
- Close Visual Studio and re-start it with Administrative priviledges (right-click > Run as Administrator).
- Change the project’s website random URL: within Visual Studio, right-click to the project node in Solution Explorer, then select Properties; navigate through the Web panel, then change the number in the Project Url textbox value.
- Add the _CSRUN_DISABLE_WORKAROUNDS Environment System variable with the value of 1 as shown in the following screenshot (thanks to Juan M. Elosegui for reporting this on this SO thread and for the image):
In case you manage to fix the issue, let us know which of the given workarounds worked for you by leaving a feedback in this post’s comment section.
That’s it for now: happy coding!
re-started visual studio with Administrative privileges and it worked
The above solution worked perfectly, thanks :)
Thank you so much, All the other threads I found didn’t help. I completed steps 1-4 before trying again. Not sure which one did the trick but I’m up and running.
Combination of # 2 & #4 did the trick for me.
Thanks
#4 was the life saver for me
1, 2 & 3 Worked for me!
I did #1 and tested – NOPE
I did #2 and tested -Nope
I did #3 and tested Success!