IIS Express with a website, how to use inside a virtual directory?

There is a root in my working environment, and my virtual directory will be in the folder / Brazil inside the root.

When I convert my website project (and not a web application) that works correctly with Cassini at / Brazil, since my website folder is Brazilian, IIS Express places the site at the root, how can I change this?

+3
source share
1 answer

I see similar issues with IIS Express with web applications. From what I see, IIS Express actually allows you to define a folder in the “Project Url” field, but then at startup it generates 2 websites, one with a folder and the other for the root application. The problem is that it uses the same folder for both, which causes web.config inheritance problems.

My solution was to edit the hosting file and change the physical package for the root virtual directory to an empty folder on my system

For instance:

<site name="MySite1" id="1">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\VisualStudioProjects\2010\MySite1\MySite1" />
    </application>
    <application path="/ssd">
        <virtualDirectory path="/" physicalPath="C:\VisualStudioProjects\2010\MySite1\MySite1" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:59473:localhost" />
        <binding protocol="https" bindingInformation="*:44302:localhost" />
    </bindings>
</site>

For this:

<site name="MySite1" id="1">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\TEMP\New folder" />
    </application>
    <application path="/ssd">
        <virtualDirectory path="/" physicalPath="C:\VisualStudioProjects\2010\MySite1\MySite1" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:59473:localhost" />
        <binding protocol="https" bindingInformation="*:44302:localhost" />
    </bindings>
</site>
+4
source

All Articles