Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable FailFastOnErrors for debug builds #3244

Merged
merged 3 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
Loading