自从升级到 Visual Studio 2013(从 2012 年开始),我注意到在调试我的 ASP.NET MVC 5 应用程序时,我偶尔会通过 IIS Express 获得编译器错误转储:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0042: Unexpected error creating debug information file 'c:\Users\Jeff\AppData\Local\Temp\Temporary ASP.NET Files\root\368a9040\83fb9039\App_global.asax.PDB' -- 'c:\Users\Jeff\AppData\Local\Temp\Temporary ASP.NET Files\root\368a9040\83fb9039\App_global.asax.pdb: The process cannot access the file because it is being used by another process.
Source Error:
[No relevant source lines]
Source File: Line: 0
如果我打开 Process Explorer,然后搜索 App_global.asax.pdb(DevEnv.exe 具有)的句柄并强行关闭它,然后刷新页面,则此错误就会消失。但是,这很不方便,而且我在 2013 年之前从未这样做过。
任何人都知道为什么会在 2013 年间歇性地发生这种情况,但之前没有?
我能想到的唯一可能的事情是 Razor Generator 的一些模糊问题。我使用的 MSBuild 步骤,但我不知道为什么它会在 App_Global.asax 上而不是 View 上(即使那样,它也不应该编译为未修改的 View )
最佳答案
升级到 VS2013 后,我们在开发的大型 webforms 应用程序上遇到了这个问题。我们解决了从我们的 Web.Config 文件中的编译元素上删除 optimizeCompilations="true"属性的问题。
我也尝试过 VS2013 Update 1 和 VS2013 Update 2 RC,但它们都没有解决这个问题。
关于asp.net-mvc - Visual Studio 2013 持有 App_global.asax.PDB 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19916594/