Msvsmon blocks my pdbs

During the development of my media center plugin (which has several custom build steps for gac, etc.) msvsmon has a rather nasty behavior.

The first compilation usually goes well, but subsequent compilations complain that myplugin.pdb is blocked

Error 1 Unexpected error creating debug information file 'C:\Users\sam\source\myfile.PDB' -- 'C:\Users\sam\source\obj\Debug\myfile.pdb: The process cannot access the file because it is being used by another process. 

If I go from VS and nuke to the object directory, I can compile it again. Also, if I kill msvsmon.exe, I can compile again (but cannot debug)

Has anyone seen this error? Are there any workarounds?

I have already disabled live semantic errors, just in case.

+4
source share
2 answers

A simple workaround: you can often rename a locked file, even if it cannot be deleted, so just rename the blocked pdb to .pdb_ or something like that. You do not need to restart the IDE and then

+1
source

Today I had the same problem with some GAC assemblies and a link to them from my StartUp project.

My solution was to edit my StartUp project and remove the GAC link for the assembly and add the assembly again as a project link. It worked fine for me, but it is not a perfect solution ...

0
source

Source: https://habr.com/ru/post/1301392/


All Articles