views:

15

answers:

1

My debugger does not work when I start project in debug mode. But when I set checkbox

Allow the source code to different from the original version.

Debugger works. But solution not wokrs properly. For example for files with build action "Content" and Copy to outputDirectory to "Copy if newer" does not copy to bin/Debug

Is anybody know the solution?

alt text

A: 

As the checkbox suggests, if you have it on, the debugger tries to work even if what you are debugging (the exe/dll) doesn't match your source code. Normally it should be off, otherwise you can get all sorts of spurious problems. So you should try to find out why they don't match.

The debugger uses debug database files (the .pdb) to match source code and executable code. Perhaps your .pdb got messed up or is in the wrong path? Try cleaning the output and intermediate directories (normally bin and obj). Perhaps also something else in your build is strange.

Daniel Rose
I clear bin and obj folders but it not any effect. I reset visual studio. After user settings reset it works some time ,but after debugger stop to work again (breakpoints do not work)
Polaris
Could you give some more information? Do you have managed or unmanaged code (or mixed)? Note that if you have managed (say C# code) and unmanaged code mixed (Output type of the C# application as "Console Application"), you need to enable unmanaged code debugging to be able to debug unmanaged code (properties page->debug->"enable unmanaged code debugging". Alternatively you could attach the debugger to the running process (Debug menu->Attach to process). Under "attach to" you can see (and change) to what code you are attaching the debugger.
Daniel Rose