I have converted VS 2010 web application project to VS 2015. The published application to development server looks fine, but I cannot run locally. I see various posts to fix applicationhost.config file but I do not seem to find the issue. Please suggest if you can see what to fix. This is from applicationhost.config under my project directory: ~\MyReporting.vs\config
<sites>
<site name="WebSite1" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":8080:localhost" />
</bindings>
</site>
<site name="MyReporting-Site" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\<User>\Documents\My Web Sites\MyReporting-Site3" />
<virtualDirectory path="/DART" physicalPath="C:\Projects\Jupiter\Databases\DART_40\DART" />
</application>
<application path="/DART/MyReporting" applicationPool="Clr4ClassicAppPool">
<virtualDirectory path="/" physicalPath="C:\Projects\Jupiter\Databases\DART_40\DART\MyReporting" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:17588:localhost" />
</bindings>
</site>
<siteDefaults>
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
</siteDefaults>
<applicationDefaults applicationPool="Clr4IntegratedAppPool" />
<virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>
I created a WebApp project in VS 2015 that I wanted to debug locally.
Of course when I built, the results went into $(ProjectDir)\bin, but VS would modify the applicationhost.config to run in the root $(ProjectDir). As a result, I would get 404 errors for my generated files. I tried several suggestions, such as:
But that just changed which applicationhost.config was modified.
But contrary to posts I found, it did update the physicalPath.
But I couldn't find anything that would work.
I finally found a work-around that is good enough for me:
Now, when you Run your solution, it will launch the code in the Output folder.
Unfortunately, when you try to debug, you have to set your breakpoints in the Web Project files, then modifications have to be done in the Web App Project files, but that is the best solution I have been able to come up with.
NOTE:
One time I did this, it named my new Web Project the same name as my Web App Project. As such, when trying to set dependencies I couldn't tell which was which. To deal with this:
(I couldn't figure out how to rename my Web Project.)
For example, change:
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyTempName", "folder\MyTempName.csproj"
to:
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyOriginalName", "folder\MyOriginalName.csproj"
Good Luck!