1

I have been using VS2013, but just installed VS2015. The web project (not website) that I had been developing uses a virtual directory which is defined in the application.host config file. It worked fine before when debugging locally via IIS Express. But now that I'm on VS2015, it acts like the virtual host doesn't exist.

Here's what I have in the config file...

        <site name="VMCC" id="1993109772">
            <application path="/" applicationPool="Clr4IntegratedAppPool">
                <virtualDirectory path="/" physicalPath="C:\Users\myuser\Documents\Visual Studio 2013\Projects\VMCC\VMCC" />
            </application>
            <application path="/Photos" applicationPool="Clr2IntegratedAppPool">
                <virtualDirectory path="/" physicalPath="c:\VMCC Photos" />
            </application>              
            <bindings>
                <binding protocol="http" bindingInformation="*:52962:localhost" />
            </bindings>
        </site>

When I load the project as a 'website', it shows the virtual directory there, and it works when debugging. However, I don't want to develop it as a 'website' since I can't publish it. None of my old publish profiles are available when working as a 'website.'

So does VS2015 just not support this or is there some new setting I'm missing?

EDIT 1

Based on this post... Creating virtual directories in IIS express

I changed it to look like this:

        <site name="VMCC" id="1993109772">
            <application path="/" applicationPool="Clr4IntegratedAppPool">
                <virtualDirectory path="/" physicalPath="C:\Users\myuser\Documents\Visual Studio 2013\Projects\VMCC\VMCC" />
                <virtualDirectory path="/Photos" physicalPath="c:\VMCC Photos" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:52962:localhost" />
            </bindings>
        </site>

But it is still not working when debugging from VS2015.

Community
  • 1
  • 1
  • Your Photos setting is clearly an "application", not a virtual directory. – Lex Li Mar 25 '16 at 22:56
  • Lex- That was the only way I knew how to do it before. See edit 1. This looks better to me as it doesn't have it tied to its own applications. Is this how you would do it? – SpeedRacer350 Mar 28 '16 at 14:47
  • the changes are ok. Then please define what is "not working". Nobody can magically see your screen. – Lex Li Mar 28 '16 at 14:54
  • When the code tries to access files in "~/Photos/" via a Server.MapPath, it doesn't go to the virtual directory. It just tries to get them in the regular project directory. The same line of code works when debugging in VS2013 and on the full blown IIS servers, so I know it's right. There's just something weird or wrong with VS2015 IIS Express. – SpeedRacer350 Mar 28 '16 at 15:30
  • 1
    it mght be caused by the wrong config file you edited. VS 2015 uses .vs\config\applicationHost.config in solution folder, not the one in your documents folder. – Lex Li Mar 29 '16 at 01:22
  • YES! There was another config file there that had somehow already had the 'Photos' virtual directory listed but both as an application and pointing to the wrong directory. I updated it as my 2nd edit above, and now it works. thanks! – SpeedRacer350 Mar 29 '16 at 14:47

1 Answers1

3

it might be caused by the wrong config file you edited. VS 2015 uses .vs\config\applicationHost.config in solution folder, not the one in your documents folder.

Lex Li
  • 60,503
  • 9
  • 116
  • 147