Error loading web project: The URL is configured to use IIS Express as the web server but the URL is currently configured on the local IIS web server.
Today I tried to do a code review but when I tried to load the solution in Visual Studio, it failed with the following error message:
The URL is configured to use IIS Express as the web server but the URL is currently configured on the local IIS web server. To open this project, you must use IIS Manager to remove the bindings using this URL from the local IIS web server.
I wanted to use IIS to host this web project, so I had to find out why it was trying to use IIS Express…
Inside my csproj file everything looked correct:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<PropertyGroup> | |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | |
<ProductVersion> | |
</ProductVersion> | |
<SchemaVersion>2.0</SchemaVersion> | |
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | |
<MvcBuildViews>false</MvcBuildViews> | |
<UseIISExpress>false</UseIISExpress> | |
<!--Removed other settings--> | |
</PropertyGroup> | |
<ProjectExtensions> | |
<VisualStudio> | |
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> | |
<WebProjectProperties> | |
<UseIIS>True</UseIIS> | |
<AutoAssignPort>True</AutoAssignPort> | |
<DevelopmentServerPort>51134</DevelopmentServerPort> | |
<DevelopmentServerVPath>/</DevelopmentServerVPath> | |
<IISUrl>https://localhost/bo</IISUrl> | |
<NTLMAuthentication>False</NTLMAuthentication> | |
<UseCustomServer>False</UseCustomServer> | |
<CustomServerUrl> | |
</CustomServerUrl> | |
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> | |
</WebProjectProperties> | |
</FlavorProperties> | |
</VisualStudio> | |
</ProjectExtensions> |
Strange! However there is also a csproj.user file and indeed there the UseIISExpress settting was enabled:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<PropertyGroup> | |
<NameOfLastUsedPublishProfile>dev</NameOfLastUsedPublishProfile> | |
<UseIISExpress>true</UseIISExpress> | |
<IISExpressSSLPort>44309</IISExpressSSLPort> | |
<IISExpressAnonymousAuthentication /> | |
<IISExpressWindowsAuthentication /> | |
<IISExpressUseClassicPipelineMode /> | |
</PropertyGroup> |
After changing this to false, I was able to load the web project and start my review.