An error occurs while loading my ASP.NET application after it is configured for IIS
I solved my problem. I unloaded the project and edited .csproj file. I did the following changes:
<UseIISExpress>false</UseIISExpress>
to true- Remove
<UseIIS>True</UseIIS>
- Remove
<IISUrl>http://localhost/MyWebApp</IISUrl>
Then I reloaded the project. It worked. Actually it rolled back to use IIS Express.
The same problem occurred at my system and got solved by running The Visual Studio in administrator mode. The issue was IIS having the same host+port name as ASP.NET project and without administrator rights Visual Studio was not able add the website.
I had this error after switching from IIS Express to full IIS with Visual Studio 2015. I was able to load the project when I ran Visual Studio as Administrator.