Rob
Rob

Reputation: 2472

IISExpress add path to website

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>

Upvotes: 8

Views: 9228

Answers (1)

RobV
RobV

Reputation: 28655

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

Upvotes: 11

Related Questions