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

2

26

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)

Adz answered 11/11, 2013 at 21:46 Comment(4)
I have this same issue and cannot figure it out myself. Older code still running .NET 4 (not my decision) and in order to use VS2013 I have to find the temp asp.net folder, delete everything, restart VS2013 and then it might work. I wonder if it might have something to do with VS2013 failing to properly delete pdb files on build...?Gonzalez
For me it is only happening when using VS2013 as well. VS2012 on the same codebase has no issues.Cherlycherlyn
Do you also use Razor Generator?Adz
I do not use Razor GeneratorCherlycherlyn
B
30

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.

Bowfin answered 18/4, 2014 at 0:11 Comment(4)
this worked for me, although it adds another 20 seconds when i rebuild my web project.Educational
This is looking promising for our team.Cherlycherlyn
No one is having the issue after modifying this and it's been almost a month. Thanks!!Cherlycherlyn
I would like to suggest Microsoft to rename the attribute impairDebugging.Sharika
C
1

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" .

Cherlycherlyn answered 23/12, 2013 at 13:51 Comment(6)
I switched to this and then got the error again, but after restarting Visual Studio, I haven't seen it again. It could be an odd edge case of the the new 64 bit edit and continue support. I'll keep monitoring it to see if it comes back. If it doesn't by the end of the month, I'll assume this was the cause and mark this as accepted. Thanks!Adz
Unfortunately this issue still occurs for me, even after disabling Edit and Continue.Adz
This has resurfaced for our team as well.Cherlycherlyn
Has anyone resolved this? I find stopping and re-running the project is enough to solve it... for a little while...Loats
Same problem here. Do you know if anyone has submitted an issue to the Connect site?Seidel
I don't know, I know my team has not and a quick search didn't turn up a match.Cherlycherlyn

© 2022 - 2024 — McMap. All rights reserved.