Can't set <PublishAot>
in the .csproj file with multiple TargetFrameworks
#18843
-
Current behaviorIn a Uno project with multiple
Expected behaviorStandard AOT configurations should be able to use in Uno project file, like:
How to reproduce it (as minimally and precisely as possible)A project file with multiple TargetFrameworks:
Add these configurations into the .csproj file
then run WorkaroundI have to remove dotnet publish -f net9.0-desktop Works on UWP/WinUINone EnvironmentNo response NuGet package version(s)No response Affected platformsNo response IDEVisual Studio 2022 IDE versionNo response Relevant pluginsNo response Anything else we need to know?Same error on Ubuntu if only |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thanks for the report. .NET WebAssembly does not support AOT to be set this way, so does .NET Android. If you want to use those properties, you'll need to set them in a TFM conditional way, as such: <PropertyGroup Condition=" '$(TargetFramework)' == 'net9.0-desktop' ">
<PublishTrimmed>true</PublishTrimmed>
<PublishAot>true</PublishAot>
<PublishSingleFile>true</PublishSingleFile>
</PropertyGroup> Note that single file publishing is not yet fully supported by Uno, particularly on Windows. |
Beta Was this translation helpful? Give feedback.
Thanks for the report. .NET WebAssembly does not support AOT to be set this way, so does .NET Android.
If you want to use those properties, you'll need to set them in a TFM conditional way, as such:
Note that single file publishing is not yet fully supported by Uno, particularly on Windows.