Skip to content

WPF App not sending unhandled exception in Release build #1727

Description

I have created a new WPF Application (C#, Windows, Desktop) in .Net 7.0. Added a button with the following code:

        private void Button_Click(object sender, RoutedEventArgs e)
        {
#if DEBUG
            throw new Exception("Debug build: Intentionally crashed the app");
#else
            throw new Exception("Release build: Intentionally crashed the app");
#endif
        }

In debug build the crash is successfully sent to App Center after restarting the app. In release build nothing happens.

Here's the additional code in App.xaml.cs:

   protected async override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            AppCenter.Start("Your app secret here",
                  typeof(Analytics), typeof(Crashes));
        }

I removed the app secret in this problem report.

Details
Platform: Win10, WPF. .NET 7.0
SDK version 5.0.1
OS: Windows 10
Visual Studio Version 17.4.4

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions