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

前端 未结 5 934
耶瑟儿~
耶瑟儿~ 2021-01-05 03:17

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

相关标签:
5条回答
  • 2021-01-05 03:49

    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.

    0 讨论(0)
  • 2021-01-05 03:54

    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.

    0 讨论(0)
  • 2021-01-05 03:56

    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.

    0 讨论(0)
  • 2021-01-05 04:06

    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.

    0 讨论(0)
  • 2021-01-05 04:07

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

    0 讨论(0)
提交回复
热议问题