.NET för Android-varning XA1029

Exempelmeddelanden

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.

Problematik

Den här varningen utfärdas när $(AotAssemblies) anges, även när det är satt till false.

Lösning

För .NET 10- och tidigare projekt som använder Mono i stället för att använda:

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

Använd i stället:

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

För CoreCLR- eller NativeAOT-projekt tar du bort $(AotAssemblies) utan att lägga till $(RunAOTCompilation). Dessa körningsmiljöer använder inte Mono AOT-pipeline. Om $(AotAssemblies) är true medan $(RunAOTCompilation) inte är inställt eller true, leder vidarebefordran till det byggstoppande felet XA1044.