The process or thread has changed since last step

半世苍凉 提交于 2019-12-10 14:59:28

问题


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?


回答1:


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




回答2:


This icon simply means the breakpoint was hit on a different thread than the last thread you were on. It doesn't affect the program behavior at all.



来源:https://stackoverflow.com/questions/16863089/the-process-or-thread-has-changed-since-last-step

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!