Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 400
Mike Avatar asked Apr 17 '12 14:04

Mike


2 Answers

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.

like image 136
Adam Tuliper Avatar answered Oct 08 '22 03:10

Adam Tuliper


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

like image 24
user384080 Avatar answered Oct 08 '22 03:10

user384080