I have a c# Web Site type project which was developed in VS 2012. I want to use VS 2015 and I have trouble specifying a different virtual directory than the default root which is /.
In vs 2012, in the sln file there are these lines:
VWDPort = "59903"
VWDDynamicPort = "true"
VWDVirtualPath = "/myapp"
and everything works as expected, i.e. when the app launches in the browser it goes to: http://localhost:59903/myapp.
I opened the solution in VS 2015 and vs creates a hidden .vs folder where it puts the applicantionhost.config file under the .vs\config folder.
This is the entry it creates for the Web Site project:
<site name="My Web Application" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\costa\Documents\webapps\My Web Application" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:59903:localhost" />
</bindings>
</site>
I tried to play with the path settings of the application and virtualDirectory elements but nothing works.
If I set the path for the application element, the web site project doesn't load. If I leave it as is and set the path of virtualDirectory to let's say /myapp I get HTTP Error 500.0 - Internal Server Error, Module: AspNetAppInitializationFailureModule, Handler: PageHandlerFactory-Integrated-4.0 or ExtensionlessUrlHandler-Integrated-4.0 depending on the url that I try to access.
If I set the paths to just "/" everything works fine.
What puzzles me is that, when I select the Web Site project in the solution explorer, in the properties window the SSL URL and URL properties are disabled. I don't know where it's getting them from. I thought the URL comes perhaps come from the applicationhost.config file.
In the web site property pages window, under Start Options, I have Start Action = Use current page, Server = Use default Web Server.
I am using VS2015 with Update 3 on a windows 2008 R2 SP1 VM (don't ask me why it's like this).
Any ideas?
I did do some research but I couldn't find anything. One other obscure thing (imo) is the ability to create sites or virtual directories in IIS express by choosing: New Web Site -> Browse -> select Local IIS on the left side. I am not too sure what this has to do with an existing web site project.
Thanks