Avviso XA1029 di .NET per Android

Messaggi di esempio

warning XA1029: The 'AotAssemblies' MSBuild property is deprecated. Edit the project file in a text editor to remove this property, and use the 'RunAOTCompilation' MSBuild property instead.

Issue

Questo avviso viene generato ogni volta che $(AotAssemblies) viene specificato, incluso quando è impostato su false.

Soluzione

Per i progetti supportati .NET 10 e versioni precedenti che usano Mono, anziché usare:

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
  <AotAssemblies>true</AotAssemblies>
</PropertyGroup>

Usare invece:

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
  <RunAOTCompilation>true</RunAOTCompilation>
</PropertyGroup>

Per i progetti CoreCLR o NativeAOT, rimuovere $(AotAssemblies) senza aggiungere $(RunAOTCompilation). Questi runtime non usano la pipeline Mono AOT. Se $(AotAssemblies) è $(RunAOTCompilation) mentre true non è impostato o è true, l'inoltro genera l'errore XA1044 che blocca la compilazione.