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\test\AppData\Local\Temp\Temporary ASP.NET Files\root\c316c4e5\4e8c267\App_GlobalResources.PDB’ — ‘c:\Users\test\AppData\Local\Temp\Temporary ASP.NET Files\root\c316c4e5\4e8c267\App_GlobalResources.pdb: The process cannot access the file because it is being used by another process.
Above compilation error seems to occur whenever I try to update .aspx or .ascx while the web application is running under debug mode. Here’re some of possible ways to address this issue.
- In Visual Studio, go to Tools > Options > Debugging > Edit and Continue > Uncheck Enable Edit and Continue
- Try removing OptimizeCompilations=”True” attribute from the compilation element in the Web.config
- Hit Restart button or CTRL+SHIFT+F5 to restart the web app
- Switch to Release build
- Stop debug and clean solution