Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2013 holding on to the App_global.asax.PDB file?

Ever since upgrading to Visual Studio 2013 (From 2012), I've noticed that while debugging my ASP.NET MVC 5 app, I'll occasionally get a compiler error dump through IIS Express of:

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

This error goes away if I open up Process Explorer and then search for the handle to App_global.asax.pdb (that DevEnv.exe has) and forcefully close it and then refresh the page. However, that's inconvenient and I've never had to do that before 2013.

Anyone have an idea on why this is happening intermittently on 2013 but not before?

The only possible thing I could think of was some obscure issue with Razor Generator's MSBuild step that I use, but I couldn't figure why it'd be on the App_Global.asax and not a view (and even then, it shouldn't be compiling for an unmodified view)

like image 967
Jeff Moser Avatar asked Nov 11 '13 21:11

Jeff Moser


People also ask

Where are pdb files located?

pdb file stores all debug information for the project's .exe file, and resides in the \debug subdirectory.

How to debug a PDB file?

The easiest way to use the PDB file is to let Visual Studio do the heavy lifting - either launch your program with Visual Studio's "Debug" command (F5 by default), or run the program and use the "Attach to Process" item in Visual Studio's Debug menu.

What is the use of PDB file in c#?

A program database file (extension . pdb) is a binary file that contains type and symbolic debugging information gathered over the course of compiling and linking the project. A PDB file is created when you compile a C/C++ program with /ZI or /Zi or a Visual Basic, Visual C#, or JScript program with the /debug option.

What is PDB file in. net?

A PDB file is an auxiliary file produced by a compiler to provide other tools, especially debuggers, information about what is in the main executable file and how it was produced. For example, a debugger reads a PDB to map foo. cs line 12 to the right executable location so that it can set a breakpoint.


2 Answers

After upgrading to VS2013 we ran into this issue on a large webforms application that we develop. We solved it be removing the optimizeCompilations="true" attribute from on the compilation element in our Web.Config file.

I also tried VS2013 Update 1 and VS2013 Update 2 RC and neither of them resolve this issue.

like image 90
Neil Avatar answered Oct 03 '22 14:10

Neil


I'm not sure if our issues are identical, but I solved the issue for me by disabling Edit and Continue.

Tools -> Options -> Debugging -> Edit and Continue -> Uncheck "Enable Edit and Continue" .

like image 26
grossadamm Avatar answered Oct 03 '22 16:10

grossadamm