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

那年仲夏 提交于 2019-11-30 19:23:00

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.

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

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.

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!