locked
VS2015 IIS Express cannot create virtual directories RRS feed

  • Question

  • User1325013520 posted

    There is a pretty common pattern in use for Asp.Net development where you would like to debug your web site in visual studio using IIS express but with a URL other than http://localhost:xxxx (xxxx being some port number of your choosing). For example your web site is going to be deployed at http://mywebsite.com and you would like to debug with IIS Express on your localbox using the URL http://mywebsite.com so you can test integration with other web sites etc. Well, there are many articles on the web that talk about how to go to about setting this up. The two main steps consist of editing %USERPROFILE%\documents\IISExpress\config\applicationHost.config  to set the virtual directory name to your site's DNS name, then editing your hosts file to redirect your dns name to 127.0.0.1.

    Well, I've been trying to figure out why my project that is set up this way would not work when I installed and tried to use VS2015. It turns out that in VS2015, someone decided to move the %USERPROFILE%\documents\IISExpress\config\applicationHost.config that VS used to use to $[solutionDir]\.vs\config\applicationhost.config. Since my %USERPROFILE%\documents\IISExpress\config\applicationHost.config file was now being ignored by VS2015 my project would no longer load.

    Does anyone know why this breaking change was introduced and where it is documented? I still haven't found documentation on this and there are *a lot* of articles on the web that talk about using %USERPROFILE%\documents\IISExpress\config\applicationHost.config which now appear to all be wrong/irrelevant for VS2015.

    Saturday, September 12, 2015 7:58 PM

Answers

  • User-166373564 posted

    Hi,

    To create virtual directories in VS2015 IIS Express:

    1) In Solution Explorer, right click the your project and click Properties.

    2) In the left tab, click Web.

    3) Select IIS Express, input your Project Url.

    my %USERPROFILE%\documents\IISExpress\config\applicationHost.config file was now being ignored by VS2015 my project would no longer load.

    For this issue, this will be helpful for you to fix it, see: Running IIS Express from the Command Line

    With regards,

    Angie

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 13, 2015 11:31 PM

All replies

  • User-166373564 posted

    Hi,

    To create virtual directories in VS2015 IIS Express:

    1) In Solution Explorer, right click the your project and click Properties.

    2) In the left tab, click Web.

    3) Select IIS Express, input your Project Url.

    my %USERPROFILE%\documents\IISExpress\config\applicationHost.config file was now being ignored by VS2015 my project would no longer load.

    For this issue, this will be helpful for you to fix it, see: Running IIS Express from the Command Line

    With regards,

    Angie

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 13, 2015 11:31 PM
  • User-1140831966 posted

    If someone can't create virtual directory for existing filesystem web site. Do the following steps.

    1. Open VS2015 (Right click and select Run as administrator).
    2. Click File > New > Web Site...
    3. In the New Web Site dialog, click Browse... button.
    4. Select Local IIS in the left pane. And select IIS Express Sites in the right pane.
    5. There are 4 buttons in right side on top. Click Create New Site button.
    6. Give name and click Open.This will select HTTP in Web location.
    7. Click OK.
    8. Then close the solution.
    9. Open applicationhost.config from Users\\Documents\IISExpress\config folder. You can open in the notepad.
    10. Find your web site in sites section. And change the physical path inside (virtualDirectory path="/" physicalPath="C:\WebApp\WebSite1"). Write the path of your existing Web Project.
    11. Save and close applicationhost.config file.
    12. Run VS2015 (Run as administrator).
    13. Click File > Open > Web Site...
    14. In the Open Web Site dialog, select Local IIS from left pane.
    15. Select your site under IIS Express Sites and click Open.
    16. Click Web Site menu and New Virtual Directory...
    17. Give Alias Name and Folder path and click OK.
    Sunday, September 27, 2015 10:16 PM
  • User-782232518 posted

    If you found it too difficult to get things right, you can try Jexus Manager, https://jexus.codeplex.com/releases/view/138373 Super easy to use if you know how to use IIS Manager.

    Friday, October 9, 2015 9:35 AM