Skip to content

UnhandledException not fire in publish(realsed) mode as exe #21485

Open
@danies8

Description

@danies8

Description

Hi,

Can you please check with sample code attached,

why UnhandledException not work in reeased mode after publish.

public partial class App : Application {

public App() {

InitializeComponent();
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

}

private async void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) {

try { } catch (Exception) { } }

FlyoutExample.zip

Steps to Reproduce

  1. Open the attached app.
    2..Publish it in cmd.
    dotnet publish -f net8.0-windows10.0.19041.0 -c Release -p:WindowsPackageType=None -p:WindowsAppSDKSelfContained=true - -p:RuntimeIdentifierOverride=win10-x64
    3.Throw exception from one of pages.
    4.Unhandled exception not fire?

Link to public reproduction project repository

......

Version with bug

8.0.3 GA

Is this a regression from previous behavior?

No, this is something new, Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

.....

Did you find any workaround?

No

Relevant log output

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-publishingIssues with the app packaging/publishing process (ipk/apk/msix/trimming)platform/windowss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions