diff --git a/src/vm/debugdebugger.cpp b/src/vm/debugdebugger.cpp index 36177401d832..c8b76bf6dcce 100644 --- a/src/vm/debugdebugger.cpp +++ b/src/vm/debugdebugger.cpp @@ -1367,11 +1367,6 @@ FCIMPL4(INT32, DebuggerAssert::ShowDefaultAssertDialog, int result = IDRETRY; - if (NoGuiOnAssert()) - { - return FailTerminate; - } - struct _gc { STRINGREF strCondition; STRINGREF strMessage; @@ -1419,25 +1414,33 @@ FCIMPL4(INT32, DebuggerAssert::ShowDefaultAssertDialog, windowTitle.Set(W("Assert Failure")); } - // We're taking a string from managed code, and we can't be sure it doesn't have stuff like %s or \n in it. - // So, pass a format string of %s and pass the text as a vararg to our message box method. - // Also, varargs and StackSString don't mix. Convert to string first. - const WCHAR* msgTextAsUnicode = msgText.GetUnicode(); - result = EEMessageBoxNonLocalizedNonFatal(W("%s"), windowTitle, stackTraceText, MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION, msgTextAsUnicode); - - // map the user's choice to the values recognized by - // the System.Diagnostics.Assert package - if (result == IDRETRY) - { - result = FailDebug; - } - else if (result == IDIGNORE) + if (NoGuiOnAssert()) { - result = FailIgnore; + fwprintf(stderr, W("%s\n%s\n%s\n"), windowTitle.GetUnicode(), msgText.GetUnicode(), stackTraceText.GetUnicode()); + result = FailTerminate; } else { - result = FailTerminate; + // We're taking a string from managed code, and we can't be sure it doesn't have stuff like %s or \n in it. + // So, pass a format string of %s and pass the text as a vararg to our message box method. + // Also, varargs and StackSString don't mix. Convert to string first. + const WCHAR* msgTextAsUnicode = msgText.GetUnicode(); + result = EEMessageBoxNonLocalizedNonFatal(W("%s"), windowTitle, stackTraceText, MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION, msgTextAsUnicode); + + // map the user's choice to the values recognized by + // the System.Diagnostics.Assert package + if (result == IDRETRY) + { + result = FailDebug; + } + else if (result == IDIGNORE) + { + result = FailIgnore; + } + else + { + result = FailTerminate; + } } HELPER_METHOD_FRAME_END();