Visual-studio – Visual Studio Creating Debug File In Release Mode

debuggingvisual studiovisual-studio-2008

I asked a similar question a while ago Error Creating Debug Information – Code Won't Compile but never found a solution.

That problem seems to have evolved a bit. Now Visual Studio is creating a PDB debug file even when the application is in Release mode and debugging is turned off in Web.config. This PDB file is getting locked by Visual Studio and sometimes w3wp.exe. Compiling fails saying the PDB file is in use by another process (devenv.exe, w3wp.exe, or both). I cannot compile until I use Unlocker to release all the locks.

First off why is VS creating a debug file when in release mode?

Secondly how can I fix this? I have run a repair install on VS and re registered ASP.Net with IIS but that didn't help. I am using Windows Server 2003, VS 2008 Standard, and IIS6.

The first symptoms showed up a week or two ago when I was working on a WPF application. Until today putting the project in Release mode made the problem go away. Now it is happening even in Release mode.

Any ideas?

Best Answer

Did you try this: http://callicode.com/Homeltpagegt/tabid/38/EntryId/24/How-to-disable-pdb-generation-in-Visual-Studio-2008.aspx?

You can also add custom after-build event to release configuration to delete the pdb file if everything else fails.