Causing VS2010 debugger to break when Debug.Assert fails

后端 未结 7 2111
南笙
南笙 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:33

    If using the DefaultTraceListener you can add the following section to your app.config file which enables breaking on Debug.Assert(false):

    
       
          
       
    
    

    For details see assert element and DefaultTraceListener.AssertUiEnabled Property.

提交回复
热议问题