2
votes

An ASP.NET C# project would't load with error:

The site for the URL 'http://localhost:51752/', configured for Web project 'AndroidWS', exists on both the local IIS web server and the IIS Express web server. You need to use IIS Manager to change this site's binding(s) in IIS.

If I delete

<site name="AndroidWS" id="1"> ... </site>

section from IIS Express configuration file, I get another kind of error:

The URL 'http://localhost:51752/' for Web project 'AndroidWS' 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.

But this project is not configured to use IIS Express:

<UseIISExpress>false</UseIISExpress>
<UseIIS>false</UseIIS>

The only way to open this project is to set:

<UseIIS>true</UseIIS>

Ok, it is a workaround, but I am not very comfortable with it because of our team work process - I have to set this parameter back to false before every check-in.

PS. This situation repeats for all projects - Visual Studio says that they are configured to use IIS Express, but they are not.

3
I use local IIS (not IIS Express) and run VS2013 with administrator privileges.plazmer

3 Answers

7
votes

Deleting the csproj.user did the trick. The message

"xxx 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."

is misleading as the conflicting info is not in IIS but in the csproj.user file.

0
votes
  1. When you create WebApplication type of project in Visual Studio you have three option for servers i.e. UseIISExpress, UseIIS and ExternalHost. (If IIS is not installed then 2 options only i.e. IIexprss and External Host)
  2. So essentially you must choose one option out of these 3 options. Default is IISExpress. You can not set ALL server options to false in project file. Even if you do that Visual Studio assums default option i.e. IISExpress is enabled.
  3. If you need to use local IIS while rest of team uses IISExpress then you can select "Local IIS" option from servers dropdown and unlcheck checkbox "Apply server settings to all users" which is located just above servers dropdown. This will save configuration settings in .csproj.user file which you dont need to check in into source control. This way you will use local IIS while team will continue using IIS Express.
-1
votes

Deleted all sites from IIS Manager, except "Default Web Site", now everything is OK.