Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Express with Website Project, how to use inside virtual directory?

My production environment have a root, and my virtual directory will be at /brazil folder inside the root.

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

like image 201
Felipe Pessoto Avatar asked Sep 10 '25 07:09

Felipe Pessoto


1 Answers

I'm seeing similar problems with IIS Express with web applications. From what I'm seeing, IIS Express actually allows you to define a folder in the 'Project Url' field, but then when launching it generates 2 websites, one with the folder and another for the root application. Problem with this is that it is using the same folder for both which brings web.config inheritance issues.

My solution was to go edit the hosting file and change the physicalPath for the root virtual directory to an empty folder in my system

For example:

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

To 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>
like image 138
Raul Vejar Avatar answered Sep 13 '25 06:09

Raul Vejar