Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The process or thread has changed since last step

I'm debugging some of my code on Visual Studio. This code belongs to a custom Session Provider that I created, and I'm debugging it on my web application launch. It starts initializing my provider, and on that function I have a breakpoint that is being hit successfully the first time. However, that same breakpoint is being hit again, but it has a small blue icon and if you hover over, this message is displayed:

The process or thread has changed since last step

On my research I've found several kinds of answers, from people saying that the breakpoint is hitting a different assembly to some others saying that the breakpoint has been hit from a different thread.

Does anybody know what does this really mean?

like image 639
pollirrata Avatar asked May 31 '13 17:05

pollirrata


People also ask

How do I view threads in Visual Studio?

To display the Threads window in break mode or run mode While Visual Studio is in debug mode, select the Debug menu, point to Windows, and then select Threads.


1 Answers

When you have multiple threads running the same piece of code and you have a breakpoint there, Visual Studio will stop the execution every time any of those threads hit the breakpoint. This will happen for every thread, in an unpredictable order. When you are debugging step by step on your code, another thread can execute the code that you were debugging and hit the breakpoint. Visual Studio will let you know about this by putting that blue circle with the exclamation mark on the next statement arrow.

See more here: Debug Multithreaded Applications in Visual Studio

like image 97
vgaspar.travix Avatar answered Nov 15 '22 07:11

vgaspar.travix