I was working on some demos today moving from a VM to my core host OS and when I tried to open the solution in VS12 that contains a handful of ASP.NET and WCF Service application projects, VS refused to so so, reporting the following error:
The URL X for Web project Y is configured to use IIS as the web server but the URL is currently configured on the IIS Express web server. To open this project, you must edit the 'C:\Users\User\Documents\IISExpress\config\applicationhost.config' file to change the port of the site currently using the URL in IIS Express.
I remembered that I had shut down IIS because I was working on some node.js stuff, so I started all services and still had no luck.
From there, I went into the config file for IISExpress as directed and changed the ports to something other than 80, still to no avail.
The solution was to open the .csproj files, find the UseIIS element and change it to False:
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>4383</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost/StatusStreamClient</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
Of course, you’ll need to reset this though the project properties based on whether you want to use IISExpress or IIS to host your application.
I’m not sure if this is a bug or an environmental issue, but regardless, I can’t imagine why the presence of a web server or lack thereof should ever be a reason to stop a solution from loading projects, ever. If I have time, I may log this to Connect, and if anyone has any insights, please let me know.
Until then, hope this help should you run into the same issue.