31
votes

On the surface, this looks a lot like I want to use iis 7 instead of iis express in visual web developer 2010, or Visual Studio USE LOCAL IIS WEB SERVER issue with IIS 7.5.

But, my problem is that there is no entry in applicationhost.config for this application and there is no application under IIS pointing to this project.

Plus, when I change the URL on the "Project Url:" under the project properties -> web tab, I get the same error - no matter that I type in.

Complete Original Error message (note, changed to MyServer.com because link could not point to LocalHost)

[Unable to create the virtual directory. The site for the URL 'http://MyServer.com/MyTestProject' exists on both the local IIS web server and the IIS Express web server. You need to edit the 'C:\Users\XXXXX\Documents\IISExpress\config\applicationhost.config' file to change the port number in use by IIS Express, or use IIS Manager to change this site's binding(s) in IIS.]

I can change this to 'http://MyServer.com/SuperLongRandomName10985486' and I still get the same error, but now with the new url.

And, yes, I am running VS as administrator

Something seems "stuck"

6

6 Answers

48
votes

Try deleteing applicationhost.config or move it to a different folder, worked for me.

In my case the problem was that the project was set up to start on IIS local by another developer.

23
votes
  • Close the solution

  • Delete the files in your C:\Users\<username>\Documents\IISExpress\config

    directory.

  • Open the solution

6
votes

Edit the ****.sln file in NotePad and change the following setting to FALSE

<UseIISExpress>false</UseIISExpress>

(There will be multiple instances.)

As soon as I did this my project loaded just fine.

2
votes

For me it was: delete *.csproj.user file!

0
votes

No need to delete applicationhost.config file

I had hostname specified in IIS bindings as well as in visual studio project URL.

Try removing hostname from IIS bindings and leave it blank. It worked for me!!! No error was shown and i was able to load solution and browse as it is from IIS as well

-1
votes

I also had to change the iis express bindinginfo port in:

C:\Users\USERNAME\Documents\IISExpress\config\applicationhost.config from 80 which iis was using. I change 80 to 3486 in my example below...

<site name="yoursite-Site" id="108">
<other things removed just to get to showing you the bindingInfo...
<bindings>
    <binding protocol="http" bindingInformation="*:3486:localhost" />
</bindings>
</site>