Conditional Breakpoints on Call Stack

后端 未结 2 1194
谎友^
谎友^ 2021-02-01 06:50

Is it possible to specify a breakpoint in Visual Studio 2010 that hits only if the calling methods up the call stack meet some specific condition? For example, and most likely,

2条回答
  •  暖寄归人
    2021-02-01 07:11

    Right click the breakpoint, choose "Condition" and use something like this:

    new System.Diagnostics.StackTrace().ToString().Contains("YourMethodName")
    

提交回复
热议问题