locked
Virtual directories above application level in IIS Express RRS feed

  • Question

  • User2051957240 posted

    Hi all

    In IIS Express you define virtual directories such as this:

                <site name="WebSite1" id="1" serverAutoStart="true">
                    <application path="/">
                        <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
                    </application>
                    <application path="/MyWebApp" applicationPool="Clr2IntegratedAppPool">
                        <virtualDirectory path="/" physicalPath="D:\Dev\GWS\Source\Wcm.PublicWeb.Skeleton.Gardena" />
                        <virtualDirectory path="/MyVirtualDirectory" physicalPath="d:\Something" />
                    </application>
                </site>

    And that makes http://localhost:8080/MyWebApp/MyVirtualDirectory" point to "d:\Something". And that is fine when we use paths that start with "~", like "~/MyVirtualDirectory". However, in our web project, we have some paths pointing to "/OtherVirtualDirectory", which exits above MyWebApp and tries to find the URL http://localhost:8080/OtherVirtualDirectory. This was no problem when we worked with standard IIS because we could just create a virtual directory directly under Default Web Site, but this seems impossible in IIS Express.

    Anyone?

    Tuesday, June 14, 2011 12:19 PM

All replies

  • User1196771204 posted

    is there any particular reason you are hosting your site on an IIS Express?
     

    Wednesday, June 15, 2011 12:04 AM
  • User2051957240 posted

    Mainly so we don't have to run Visual Studio in administrator mode just to be able to debug, but also because it's a smaller, more light-weight web server intended for developers. But that is not the issue :-)

    Thursday, June 16, 2011 4:09 AM
  • User-782232518 posted

    The virtual directory you want can also be created by editing the config file,

                <site name="WebSite1" id="1" serverAutoStart="true">
                    <application path="/">
                        <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
    <virtualDirectory path="/OtherVirtualDirectory" physicalPath="d:\SomethingElse" /> </application> <application path="/MyWebApp" applicationPool="Clr2IntegratedAppPool"> <virtualDirectory path="/" physicalPath="D:\Dev\GWS\Source\Wcm.PublicWeb.Skeleton.Gardena" /> <virtualDirectory path="/MyVirtualDirectory" physicalPath="d:\Something" /> </application> </site>
    Friday, October 9, 2015 8:48 AM