Visual Studio 2010 SP1 - C# PDB file corrupt - shows wrong line numbers
I have a problem with a single C# project in a solution of 21 C# projects (ANY CPU).
Break points aren't hit - and when I force the debugger to attach (Debugger.Launch()), I can see that the call stack shows the correct functions however the line numbers are very wrong.
In a concrete example, I have a break point in line 346 of 1020 lines - but the debugger navigates to line 10745 which results in the debugger showing results from a totally different file. From log files I can see that the correct methods are being executed.
After much headache I therefore chose to try on 2 different machines with VS 2010 SP1 installed - and these showed the exact same behavior.
I have already tried to do a full clean of the solution, manually delete all PDB files, restart VS, restart the machine, emptied the VS Symbol Cache (Tools > Options > Debugging > Symbols), removed all "Symbol file (.pdb) locations" and delete the solution's ".SDF" database.
I am compiling the project in Debug mode, and have verified that "Optimize code" is not enabled on the project.
Break points in different projects in the solution does work - so it seems it is only this one project that for some reason generates a corrupt PDB file. However, I can't really see why this single project should differ from the other projects. The only real difference is that I have 2 web 开发者_JAVA百科references in this particular project - and funny enough it is in these stub classes that the PDB file always instructs the debugger to end up.
The particular solution is being compiled and debugged on a fully patched Windows 2003 x86 machine.
I would appreciate if anyone could give me a hint how to solve this problem.
Try right click on the project, go to the build tab->click advanced button->check output area->select debug info to pbd-only. Sometimes it changes.
精彩评论