Skip to content

Can't set <PublishAot> in the .csproj file with multiple TargetFrameworks #18843

Answered by jeromelaban
felixf4xu asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by felixf4xu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined.
2 participants
Converted from issue

This discussion was converted from issue #18838 on November 19, 2024 13:20.