Reputation: 2061
I have a C# program in which the debugger has very peculiar behavior in regards to breakpoints.
If the breakpoints are already set when I "Start Debugging", then the debugger stops at the breakpoints.
If I add breakpoints while the program is running, the debugger will not stop at any of those breakpoints. However, the debugger will continue to stop at the breakpoints which were already set when I started the program. To get the new breakpoints to work correctly, I have to stop the program and then start it again or detach and then re-attach the debugger.
Also, if I disable a breakpoint while the program is running and then I re-enable the breakpoint, then the debugger no longer stops on that breakpoint. In order for the breakpoint to work correctly again, I have to stop the program and then start it again or detach and then re-attach the debugger.
I would prefer not to have to detach and re-attach the debugger every time that I want to add a new breakpoint. Does anyone know why this is happening and how to make it so that the debugger correctly stops at breakpoints which are added during runtime? This doesn't happen with any other programs. Only this 1 program has this issue. With all of other programs I've ever debugged, I am able to set breakpoints during runtime and the debugger stops with no problems.
I am using Visual Studio 2010 service pack 1 and .NET framework 4. Though, the issue also existed when I was using older versions of the .NET framework.
Upvotes: 0
Views: 1072
Reputation: 2061
I have finally figured out what the problem was. We use a tool that strips information from our .DLLs. Using these 'stripped' .DLLs caused the debugging issues.
Using the unstripped .DLLs makes all of these breakpoint issues go away!
Upvotes: 0
Reputation: 489
Your source code and assembly could be out of sync - rebuild the application and try again. P.S : it is strange that i have heard a lot about this problem with VS2010 :D
EDIT : if you are using some kind if dlls, maybe you nead the debugging symbols (the "pdb" file) to be in the same folder as the dll.
Upvotes: 0
Reputation: 851
Clean your solution and rebuild again. It will solve the problem
Upvotes: 1