I want to use iis 7 instead of iis express in visual web developer 2010
Asked Answered
G

5

8

I am having some trouble setting up my vwd 2010 environment to run under my local iis 7.5 instead of iis express.

Whenever I go to the project properties and select the 'web' tab, I choose under Servers, 'Local iis web server'. It automatically puts in the Project URL http://localhost/myprojectname.

I click Create Virtual Directory and it comes up with this warning,,,

'Unable to create the virtual directory. The site ofr the url http://localhost/myprojectname exists on both the local IIS Web server and the IIS Express web server. You need to edit the 'c:\Users\Mike\Documents\iisexpress\config\applicationhost.config' file to change the port number in use by iis express or use iis manager to change the sites binding(s) in iis.'

Your help is greatly appreciated in explaining why I can't use the built in functionality to use iis 7.5 instead of iis express.

Thank you in advance.

Grosbeak answered 17/4, 2012 at 14:5 Comment(0)
S
10

This issue can happen because there is a site setup in IISExpress bound to port 80, which is also used by regular IIS.

Open up the applicationhost.config as it mentions and look for something like:


<site name="SomeAppName-Site" id="15">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
    <virtualDirectory path="/" physicalPath="C:\Users\YourName\Documents\My Web Sites\SomeProjectsWebSite" />
    </application>
    <bindings>
       <binding protocol="http" bindingInformation="*:80:localhost" />
    </bindings>
</site>

Note the part that says :80 change this to some other port so it's not shared with 80, and not in use by another application in IISExpress. You can look over the other site nodes in applicationhost.config to find one not used, or try 8081 for starters.

Streamliner answered 25/10, 2012 at 15:45 Comment(2)
Thanks, I had this problem too after reinstalling VS 2012 and trying to load my existing mvc app, which uses IIS and not the express edition.Emigration
But both iis and express are using the same port - as the error says. Your iis express config lists this port as well as full iis an thus the conflict.Streamliner
S
2

in the applicationhost.config, locate the site's name and remove its site section.. then try to reload your web site project again

Edited:

1) Find the "myprojectname" site in the applicationhost.config and completely delete its section

<site name="myprojectname" id="15">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
    <virtualDirectory path="/" physicalPath="C:\Users\YourName\Documents\My Web Sites\SomeProjectsWebSite" />
    </application>
    <bindings>
       <binding protocol="http" bindingInformation="*:80:localhost" />
    </bindings>
</site>

2) In visual studio under the solution explorer, right click on the project and then select "Reload project".

Sequel answered 25/3, 2013 at 6:54 Comment(1)
I'd recommend explaining how to do this, or giving some links and summarize.Marva
L
1

I did try the suggestions where you remove the site from the applicationHost.config file, in these locations:

IIS Express:

%userprofile%\documents\iisexpress\config\applicationHost.config

%userprofile%\my documents\iisexpress\config\applicationHost.config

IIS:

%WINDIR%\System32\inetsrv\config\applicationHost.config

However, that did not work for me. I found that I also had to delete/rename the project's user file located within the Visual Studio project folder.

Example C# project name is: MyProject

The file to rename/delete: MyProject.csproj.user

It's an xml file which does have some stored settings about the web project.

I closed VS. Renamed the file. Opened VS, and the project loaded just fine.

Lashondra answered 14/12, 2013 at 0:11 Comment(0)
C
0

You probably already have a website called "myprojectname" set up in IIS. Go to the config file that it mentions and find the place where that project is defined. Remove that node from the XML, and try again.

Cotopaxi answered 17/4, 2012 at 14:9 Comment(1)
I had tried this already and it didn't work. Thanks for your reply and time. I actually, through frustration, just uninstalled iis express and now it seems to work as expected. Thanks again for your time though.Grosbeak
C
0

I ran into the same issue and decided to select "Use Custom Web Server", instead of "Use Local Web Server".

I set up my site in my local IIS 7 to be at "http://localhost:8080" (another app is already using port 80). Then, I just put that into the "Server URL" box.

She's working like a charm, huzzah.

Curagh answered 8/1, 2014 at 18:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.