The process or thread has changed since last step (Visual Studio)

If you can't run in one thread to debug, or don't want to change something to do it , To make debugging easier, You can also break conditionally using filter is true ThreadId == xxxxx (right-clicking the breakpoint).

you break in the method you want with a regular breakpoint, look which threadid is the current one (there will be an arrow) in Threads window (Debug - > Windows -> Threads). the next breakpoints could be conditional as I suggested.

note that in a different run the thread id will change and you'll have to update it in Breakpoints window.


You've got more than one thread executing the same method and they all hit the same breakpoint. When you continue stepping, the debugger cannot accurately guess anymore which thread it should show the state for. So you just get a warning that you are now looking at the state of a different thread. The local variable values are liable to be different. As is the execution location of course, the reason the highlight changes.

Clearly this can make debugging more difficult. You want to avoid this if you are still getting bugs out of the code, start just one thread. Beyond that, a temporary workaround is to use Debug + Windows + Threads, right-click one of the threads and select Freeze. Don't forget to unfreeze again.