Debug.Assert doesn't break into editor in MonoDevelop / MonoTouch

Simply put, Debug.Assert calls that do not complete the execution flow of a program in MonoDevelop simply print a trace message that starts like this (followed by a stack trace):

 2012-12-28 19:21:01.978 TestApp[81689:c07] ---- DEBUG ASSERTION FAILED ---- 2012-12-28 19:21:01.979 TestApp[81689:c07] ---- Assert Short Message ---- 

What can I do to make a failed Debug.Asserts break execution on Assert in MonoDevelop?

+4
source share
1 answer

Parts of the Debug.Assert debugger Debug.Assert are not yet implemented - see Xamarin bug # 4650 .

I looked at this several times a couple of months ago, and then realized that it would require runtime support to automatically turn off the top frames (so MonoDevelop will stop in the Debug.Assert , and not somewhere in the implementation of the trace listener).

As a workaround, you can add a custom trace listener and call Debugger.Break() .

+5
source

All Articles