From 621c29890ba66187fe1911e6399621deff5ddf3f Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Mon, 9 Sep 2024 13:45:04 +0200 Subject: [PATCH] feat: Allow disabling generated Application.UnhandledException handler (cherry picked from commit 307acc118f10321660ae0d9e88443c92ecc35182) --- .../Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs b/src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs index dad30c70eb21..1b715a61074e 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs @@ -568,7 +568,7 @@ void ApplyLiteralProperties() void AttachUnhandledExceptionHandler() { - writer.Append($"#if DEBUG"); + writer.Append($"#if DEBUG && !DISABLE_GENERATED_UNHANDLED_EXCEPTION_HANDLER"); writer.AppendLine(); writer.AppendLineIndented($"UnhandledException += (s, e) =>"); writer.AppendLineIndented("{");