-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
-
.NET Core Version: .NET Core 3.1 onwards
-
Have you experienced this same bug with .NET Framework?: No
Problem description:
System.Diagnostics.Trace.Assert and System.Diagnostics.Debug.Assert no longer trigger a dialog prompts in desktop apps. Instead apps silently silently crash unless have a debugger attached.
As discussed in dotnet/runtime#40512, the assert behavior was changed in dotnet/coreclr#20764, and no longer raises a dialog.
https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.Debug/tests/DebugTestsUsingListeners.cs#L248-L303 illustrates how to implement a custom trace listener, which may act as a basis for a fix.
Expected behavior:
No crash, and assertion dialog must appear after assert.
Minimal repro:
- Create new WPF Core project.
- Put
System.Diagnostics.Debug.Assert(false, "test");anywhere in the code, for example:protected override void OnActivated(EventArgs e) { System.Diagnostics.Debug.Assert(false, "test"); }
IrinaPykhova, pkostaki, techNIKtos and lindexi
Metadata
Metadata
Assignees
Labels
BugProduct bug (most likely)Product bug (most likely)