How to set a breakpoint in every method in VS2010

后端 未结 6 1188
小蘑菇
小蘑菇 2020-12-31 02:33

I have a bigger (c#) WPF application with n-classes and m-methods. I would like to place in every single method a breakpoint, so everytime i press

6条回答
  •  猫巷女王i
    2020-12-31 02:37

    You can use System.Diagnostics.Debugger.Break() on entry to your method.

    Something like this perhaps with a bool that you set at the scope?

    #if DEBUG
      if (BreakPointEveryMethod)
        System.Diagnostics.Debugger.Break();
    #endif
    

    There will be a quick way too add this for sure in notepad++ but I am not sure there is a quick and easy way for you to achieve this through a simple command line.

提交回复
热议问题