views:

348

answers:

6

Debugging in visual studio seems to have been broken with sp1. Single stepping randomly does not work and just starts to run. Sometimes breakpoints are ignored. It is unpredictable and unusable. It will generally hit the first break point but after that it is totally unpredictable.

Any idea what needs to be done to correct this behavior ?

+2  A: 

Make sure you are debuging using the debug configuration, not the release one. Also make sure optimizations are disabled in debug configuration.

Optimizations must be off when you debug else it can lead to very erratic behaviours like these.


For C# projects, which I am assuming the question is about looking at the tags, the optimization option would be located in the "Build" tab of "Project > Properties..." Last option of "General" it's called "Optimize Code".

Coincoin
A: 

Where exactly do you disable Optimization ?

If you mean the optimize code check box on the project properties, it is unchecked.

Before applying service pack 1 I did not have this problem, and I have a second machine without sp1 and it works fine. The settings are the same on both machines.

Napco
A: 

What language are you in while you're debugging? I have run into this problem with JS, but not C# in VS 2008.

Sara Chipps
A: 

We are using c# as a language.

The problem has been identified by microsoft.

quote from forums: All,

We have identified the root cause of this issue and are currently working on a solution. We apologize for the inconvenience that this is causing you. We will let you know as soon as we have a solution. In the mean time, if we discover any workrounds, we will post them here.

Thanks for your patience.

Habib Heydarian ([email protected]) Visual Studio Debugger Program Manager Lead

Napco
Try to update your question and/or comment on others questions, instead of answer your own question
Seiti
A: 

There are at least 8 people/companies with the same problem.

MSDN Forums

MSDN > Forums Home > Visual Studio > Visual Studio Debugger > Single stepping gone crazy with VS2008 installation of SP1

Napco
+1  A: 

There is a fix which for some reason isn't included in the update process:

http://code.msdn.microsoft.com/KB957912/Release/ProjectReleases.aspx?ReleaseId=1796

It worked for me although some people say they still have the same problem.

Željko Tanović
This solved it for me as well. Thanks for the link!
Jason Kester