When I'm debugging managed, multi-threaded code and I'm at a breakpoint in the Main\UnitTestRunner thread and start single stepping occasionally the debugger will switch to another thread and start stepping it's code. How can I stop this?
Using VS2010 + Resharper 5.1 if it matters.
Update 1:
A closer look at the stack after a single step (F10) command shows that many (10-30) steps were actually performed before the debugger decided to stop execution.
This is happening regularly enough to make debugging nearly impossible. This is scarily similar to the issue Hans referred to.
Update 2:
I've filed a bug on Microsoft Connect. Please "upvote" it if you are also having this issue.
Update 3:
Confirmed by M$ as a bug to be fixed in the next "servicing release." Workaround is to target unit tests to .NET 3.5 as described here.