Causing VS2010 debugger to break when Debug.Assert fails

后端 未结 7 2129
南笙
南笙 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:50

    It appears that your app removed the default TraceListener from the Debug class, and replaced it with a custom one that implements the Fail(string) method differently.

    You may be able to track it down by searching your code for Debug.Listeners and see if somewhere the default one is cleared out or modified, or see if you've got a trace section in your app.config.

    By default, from what I've read, you should definitely get the popup window.

提交回复
热议问题