Old WebSite in Visual Studio 2013 and IISExpress - Virtual Directory

I have a WebSite (not a project, WebSite) using ASP.NET Webforms, at the beginning of this WebSite was built using Casini (old visual studio web server) with "GestorAplicaciones" as virtual directory.

The start URL for the app was "http://server:port/GestorAplicaciones/Default.aspx"

Now I opened this website in Visual Studio 2013 and worked under IISExpress, but I had problems with the virtual directory.

My website in applicationhost.config was:

<site name="GestorAplicaciones" id="12">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\...\GestorAplicaciones" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:10000:localhost" />
    </bindings>
</site>

      

Finding information about the problem I found how to create a virtual directory in IISExpress, I have to do this:

<site name="GestorAplicaciones" id="12">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\Temp" />
    </application>
    <application path="/GestorAplicaciones" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\...\GestorAplicaciones" />                    
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:10000:localhost" />
    </bindings>
</site>

      

This way my website works fine with the virtual directory.

However, every time visual studio opens the solution, it changes the website configuration in applicationhost.config, it writes this again:

<site name="GestorAplicaciones" id="12">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\...\GestorAplicaciones" />
    </application>
    <application path="/GestorAplicaciones" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\...\GestorAplicaciones" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:10000:localhost" />
    </bindings>
</site>

      

Then the website doesn't work and I have to change the applicationhost.config every time I open the solution in Visual Studio.

How do I prevent visual studio from changing the website configuration in IIS Express?

+3


source to share





All Articles