31

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"

Community
  • 1
  • 1
saunderl
  • 1,618
  • 2
  • 16
  • 31

6 Answers6

50

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.

Radim Köhler
  • 122,561
  • 47
  • 239
  • 335
lsp
  • 744
  • 6
  • 19
  • @Isp OP should have done that, but if he didn't maybe your answer was not the solution to his problem. Was to mine though, that's why I upvoted you :) – Painy James Oct 24 '13 at 09:34
  • 4
    I just had to edit the applicationhost.config in "%USERPROFILE%\Documents\IISExpress\config\applicationhost.config" and remove the website from the config. – oldwizard Nov 12 '13 at 08:50
  • No, this is not the answer to my question and I actually commented that the applicationhost.config file was not the issue in the original post. Both of the linked questions talked about the applicationhost.config file and I pointed out that their solutions did not work. This is why it is not only not the accepted answer, but I downvoted it as well. – saunderl Nov 22 '13 at 23:02
  • 1
    I had this problem and renamed the file to **applicationhost.config.DO NOT USE** and presto, I can open the project again. My problem was I opened the code in VS on a new machine that did not have IIS installed/turned on so I guess it helpfully ran off and did a bunch of IIS Express things. It's made itself a new applicationhost.config but there seems to be no impact on my using the project, so I am ignoring that. – Kate Gregory Jul 16 '15 at 15:22
  • 1
    Another scenario this fixed: a bad group policy update on my machine borked my local administrator privileges, which apparently rolled over my publishing to IISExpress (literally never run once) without bothering to inform me. – downwitch Jul 29 '15 at 19:55
23
  • Close the solution

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

    directory.

  • Open the solution

Community
  • 1
  • 1
Edwin Pajemola
  • 231
  • 2
  • 2
6

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.

Alexander Bird
  • 38,679
  • 42
  • 124
  • 159
Moojjoo
  • 729
  • 1
  • 12
  • 33
2

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

  • Me too. I had the following in mine: ``` true ``` This was overriding the setting in the main .csproj file. – Bart Read Oct 29 '15 at 10:21
0

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

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>
dcarl661
  • 177
  • 3
  • 9