Skip to content

Commit

Permalink
Enable FailFastOnErrors for debug builds (#3244)
Browse files Browse the repository at this point in the history
  • Loading branch information
krschau authored Jun 19, 2024
1 parent b9c628e commit 26e01a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ private static string RemoveComments(string text)
public App()
{
InitializeComponent();
#if DEBUG
DebugSettings.FailFastOnErrors = true;
#endif
_dispatcherQueue = DispatcherQueue.GetForCurrentThread();

Host = Microsoft.Extensions.Hosting.Host.
Expand Down
4 changes: 4 additions & 0 deletions src/DevHome.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@
<DefineConstants Condition="'$(BuildRing)'=='Stable'">$(DefineConstants);STABLE_BUILD</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
</PropertyGroup>

<!-- Third party notice file -->
<ItemGroup>
<Content Include="$(SolutionDir)NOTICE.txt">
Expand Down
4 changes: 4 additions & 0 deletions src/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ private void MainWindow_Closed(object sender, WindowEventArgs args)
Application.Current.GetService<IExtensionService>().SignalStopExtensionsAsync();
TelemetryFactory.Get<ITelemetry>().Log("DevHome_MainWindow_Closed_Event", LogLevel.Critical, new DevHomeClosedEvent(_mainWindowCreated));
Log.Information("Terminating via MainWindow_Closed.");

// WinUI bug is causing a crash on shutdown when FailFastOnErrors is set to true (#51773592).
// Workaround by turning it off before shutdown.
App.Current.DebugSettings.FailFastOnErrors = false;
}
}

0 comments on commit 26e01a7

Please sign in to comment.