From 74ef5c85aebf7ebdf16575c51ef5ccc907171719 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 11 Aug 2022 19:18:32 -0500 Subject: [PATCH] [windows] Release builds use `$(PublishReadyToRun)` by default (#9357) Context: https://docs.microsoft.com/dotnet/core/deploying/ready-to-run Fixes: https://github.com/dotnet/maui/issues/9299 One of the biggest wins we see for MAUI startup on Windows is to enable "Ready to Run", which seems to improve startup by as much as 50% in templates or sample apps with a reasonable increase in app size. For example, the `dotnet new maui` template built for `win-x64`: 45375824 PublishReadyToRun-false.msix 59687908 PublishReadyToRun-true.msix This setting is already used by the WindowsAppSdk templates via publish profiles: Properties\PublishProfiles\win10-x64.pubxml Properties\PublishProfiles\win10-x86.pubxml Properties\PublishProfiles\win10-arm64.pubxml These files are just MSBuild files, but they all contain: true In .NET MAUI, I think we should just put this as a default in our MSBuild targets, and customers get it by default for `Release` builds. You can "opt out" of `PublishReadyToRun` by setting it to `false`. --- .nuspec/Microsoft.Maui.Controls.SingleProject.props | 1 + 1 file changed, 1 insertion(+) diff --git a/.nuspec/Microsoft.Maui.Controls.SingleProject.props b/.nuspec/Microsoft.Maui.Controls.SingleProject.props index 64a7144978c8..d4d5c02e0222 100644 --- a/.nuspec/Microsoft.Maui.Controls.SingleProject.props +++ b/.nuspec/Microsoft.Maui.Controls.SingleProject.props @@ -6,6 +6,7 @@ true false true + true <_SingleProjectRIDRequired Condition="'$(OutputType)' == 'WinExe'">true <_SingleProjectRIDSpecified Condition="'$(RuntimeIdentifier)' != '' or '$(RuntimeIdentifiers)' != ''">true