Causing VS2010 debugger to break when Debug.Assert fails

后端 未结 7 2128
南笙
南笙 2020-12-15 09:15

Is there any way to cause Visual Studio 2010 to break while debugging when the argument of Debug.Assert evaluates to false?

Example: in my

7条回答
  •  孤城傲影
    2020-12-15 09:46

    Use the Debugger.Break method (in the System.Diagnostics namespace). This will break execution if you are running in a debugger.

提交回复
热议问题