Visual Studio 2015 add virtual directory

iis-expressvirtual-directoryvisual-studio-2015

I have a web project in VS2015 (using IIS Express) and need to add a virtual directory for files that can be downloaded but are created by another process. I have added an entry to my applicationhost.config file as shown below. Whenever I start my server and go directly to a file at the location I receive a 404 in the IIS Express log.

<site name="CustomerPortal" id="2">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
      <virtualDirectory path="/" physicalPath="C:\Dev\WebApps\CustomerPortal\src\CustomerPortal\wwwroot" />
      <virtualDirectory path="/WebReports" physicalPath="\\backup03\WebReports" />
    </application>

    <bindings>
                <binding protocol="http" bindingInformation="*:49373:localhost" />
    </bindings>
</site>

Is there something different in VS2015 to add a virtual directory like this?

I am editing the config file in my project dir/.vs/config/applicationhost.config.

Best Answer

For VS.Net 2015:

1.- Open the file applicationhost.config located in the following path:

{your_solution_folder}\.vs\config\

2.- Search for the tag "sites" and find the tag for the project you want to create the virtual directory.

3.- Add the following lines:

<application path="/{your_virtual_directory_name}" applicationPool="Clr4IntegratedAppPool">
   <virtualDirectory path="/" physicalPath="{your_physical_path}" />
</application>

It will be something like the following: enter image description here

Related Topic