Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IISExpress add path to website

Tags:

iis

I have a website working fine on IIS express until I wanted to add a second one and have them both run off the same port number. Now I can't figure out how to get the path right. When I browse to the site after running iIS express it complains of a error:

Unrecognized configuration path 'MACHINE/WEBROOT/APPHOST/RISWEB'

and IIS Express returns error 500.19

Here is my config. When I set the path to be "/" it works, but when its something else it does not. I would like to browse to http:// c65273/risweb and have my website show up.

        <site name="RISWEB" id="1834812154">
            <application path="/risweb" applicationPool="ConnectPool">
                <virtualDirectory path="/risweb" physicalPath="C:\c2010\risweb\RISWEB" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:80:c65273" />
            </bindings>
        </site>
like image 615
Rob Avatar asked Aug 14 '12 19:08

Rob


People also ask

Where IIS Express install directory?

This file is located in the %userprofile%\Documents\IISExpress\config folder or %userprofile%\My Documents\IISExpress\config folder, depending on your OS. When you run a site from a configuration file, you can specify which site to run.

Does IIS Express use web config?

Yes, IIS Express uses the same applicationhost. config and web. config files supported by IIS.

Where is the Applicationhost config for IISExpress?

Configure IIS express on visual studio vs folder (Hidden) -> Config -> applicationhost.


1 Answers

I hit a similar problem and was able to resolve it by doing the following:

  1. Remove the configuration section for the site from my applicationhost.config
  2. In Visual Studio go to the Project Properties > Web tab and then click Create Virtual Directory to have VS recreate the configuration section.

It then worked fine, the resulting configuration section will look something like this:

<site name="WebDemos-Site" id="5">
  <application path="/" applicationPool="Clr4IntegratedAppPool">
    <virtualDirectory path="/" physicalPath="C:\Users\rvesse\Documents\My Web Sites\WebDemos-Site" />
  </application>
  <application path="/demos">
    <virtualDirectory path="/" physicalPath="C:\Users\rvesse\Documents\mercurial\dotnetrdf\Samples\WebDemos" />
  </application>
  <bindings>
    <binding protocol="http" bindingInformation="*:64132:localhost" />
  </bindings>
</site>

Note that VS generates an empty website for the root directory of the site

like image 107
RobV Avatar answered Sep 21 '22 15:09

RobV