4

I recently moved my "My Documents" folder from the C: to the D: drive. This seems to have broken my ability to debug web app in Visual Studio. I'm assuming that visual studio creates entries like the following in applicationhost.config, and I am wondering where the first physicalPath for the root virtualDirectory comes from, as I am fairly certain that is the problem (I've pretty much confirmed that VS creates an entry like the following when a solution is opened):

            <site name="My.Application-Site" id="2">
            <application path="/" applicationPool="Clr4IntegratedAppPool">
                <virtualDirectory path="/" physicalPath="C:\Users\myname\Documents\My Web Sites\My.Application-Site" />
            </application>
            <application path="/My" applicationPool="Clr4IntegratedAppPool">
                <virtualDirectory path="/" physicalPath="D:\repos\MyCheckout\My\My.Application" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:49924:localhost" />
            </bindings>
        </site>

When I try to run the app in debugger, the browser pops up with an error, the relevant bits of which are below. Notice the path to web.config still uses C:, even though it seems to know the right place for tracelogfiles:

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

Config Error       Cannot read configuration file
Config File    \\?\C:\Users\myname\Documents\My Web Sites\My.Application-Site(2)\web.config
Requested URL      http://localhost:50616/My/
Request Tracing Directory      D:\users\myname\My Documents\IISExpress\TraceLogFiles\

So the question is where in Visual Studio (or IIS) is the path for the web.config file determined, and how do I change it. And/or is there some other reason or insight anyone can provide as to why I am getting this 500.19 error?

Another recent change (other than moving My Documents) is I uninstalled a trial of VS Ultimate 2013 and installed VS Pro 2013 -- could that have somehow caused this? Both of changes have been made between the time I was last able to debug the app normally and getting this error.

Greylander
  • 1,766
  • 3
  • 19
  • 22
  • Check that iis can read that folder. – Aron Jul 14 '14 at 17:22
  • 3
    Which folder? If you mean the \C:\Users\myname\Documents\My Web Sites\My.Application-Site(2)\web.config, the whole point is that is not the correct folder anymore because I've moved "My Documents" to the D: drive. Since VS is creating the entry in applicationhost.config, I'm figuring for some reason it is ignoring that fact that I changed the location of My Documents, but have no idea where this is determined. Been looking for something relevant in VS options or project properties, etc., not finding it. – Greylander Jul 14 '14 at 17:30
  • Easiest way is to use the IIS management tool. It has a nice GUI. It's in Control Panel under admin tools. PS IIS does not use my document paths... It likely used an absolute path. – Aron Jul 14 '14 at 17:41
  • 1
    The easiest way to do what? Hmmm.. as it happens, there is no IIS manager in control panel... this is strange. Would IIS have been uninstalled when I uninstalled Visual Studio 2013 Ultimate, and then *not* re-installed with Visual Studion 2013 Pro? – Greylander Jul 14 '14 at 19:07
  • (EDIT: woops, nope... it is there in the list of installed software... ) It is looking like IIS was indeed uninstalled along with VS Ult 2013, but did not the re-install along with VS Pro 2013... though according to MS it should have... http://msdn.microsoft.com/en-us/library/58wxa9w5.aspx – Greylander Jul 14 '14 at 19:23
  • 1
    OK, So Enabled IIS manager, but no idea what I should do with it as relates to this problem. (turns out IIS was installed... but turned off in windows features, apparently as a result of uninstalling VS Ult 2013, & not turned back on by VS Pro... which in turn gives no indication that this is a problem when I run the app in debugger. Note that the app itself appears to run, there error occurs in the browser) – Greylander Jul 14 '14 at 19:45

1 Answers1

2

For someone looking for an answer to "where in Visual Studio (or IIS) is the path for the web.config file determined, and how do I change it" or "I moved my application from its origin folder"

Right-click in Project Properties > Web Tab and Create Virtual Directory buttom.

It all happened when I was developing (and debuging, of course) my application on two different machines, with different paths (and Drives) to the source code managed by git.

Hope it helps

tacitomv
  • 47
  • 5