我最近将"My Documents"文件夹从C:驱动器移动到D:驱动器。这似乎破坏了我的在Visual Studio中调试Web应用程序的能力。我假设visual studio会在applicationhost.config中创建以下条目,我想知道根virtualDirectory的第一个physicalPath来自何处,因为我非常确定这是问题所在(当打开解决方案时,我已经基本确认VS会创建像下面这样的条目):
<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>
当我尝试在调试器中运行应用程序时,浏览器会弹出一个错误提示框,相关内容如下。请注意,即使它似乎已经知道 tracelogfiles 的正确位置,web.config 文件的路径仍然使用 C:。
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\
所以问题是在Visual Studio(或IIS)中确定web.config文件路径在哪里,我该如何更改它。还有其他原因或见解可以提供,解释为什么我会收到500.19错误吗?另一个最近的变化(除了移动我的文档)是我卸载了VS Ultimate 2013的试用版,并安装了VS Pro 2013 - 这可能会导致这种情况吗?这两个更改都是在我上次能够正常调试应用程序和出现此错误之间进行的。