My Visual Studio 2008 IDE is behaving in a very bizarre fashion while debugging a unit test: I have a breakpoint and when I hit it and then try to step with F10 the test con
This behaviour also happens when you have multiple threads running.
There was a post VS2008 SP1 hotfix released that solves a number of debugging problems. The KB article is here, the hotfix download is here.
UPDATE: the hotfix download location was retired, I don't know of an alternative download location. Please edit this post if you find one.
My unit tests were testing under x86. Changing them to x64 worked.
Menu
Test
-> Test Settings
-> Default Processor Architecture
-> x64
.
Go into Project->Properties and uncheck "Optimize Code"
This is the case if you see code such as DataSet ds = new DataSet(); gets hit on the debugger but code like string Test = "Test"; gets skipped.
Even in a Debug build, compiler optimizations could explain this behaviour. Under project properties, "Build", verify that the checkbox 'optimize code' is turned off. I have seen this turned on by default after upgrading certain projects from .Net 1.1.
F10 is Step Over, F5 is continue to next breakpoint, F11 is Step Into, which executes the next line of code then waits. That is what you are probably looking for.