How to debug a single thread in Visual Studio?

后端 未结 10 1610
执笔经年
执笔经年 2020-11-28 17:59

I have a solution with some projects. There are several break-points in different projects. I want to trace the first thread hit one of these break-points and continue traci

10条回答
  •  被撕碎了的回忆
    2020-11-28 18:13

    Set a Breakpoint Condition by right clicking the side bar of the line. Select "Condition" and enter the following with the name of your thread in quotes:

    System.Threading.Thread.CurrentThread.Name=="name_of_your_thread"

    Alternatively you can do the same by getting the thread's "Managed ID" from the "Threads" Window and use:

    System.Threading.Thread.CurrentThread.ManagedThreadId==your_managed_thread_id

提交回复
热议问题