Aviso XA1029 do .NET para Android

Mensagens de exemplo

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

Esse aviso é emitido sempre que $(AotAssemblies) é especificado, inclusive quando é definido como false.

Solução

Para projetos com suporte .NET 10 e anteriores que usam Mono, em vez de usar:

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

Em vez disso, use:

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

Para projetos CoreCLR ou NativeAOT, remova $(AotAssemblies) sem adicionar $(RunAOTCompilation). Esses runtimes não usam o pipeline AOT do Mono. Se $(AotAssemblies) estiver $(RunAOTCompilation) enquanto true não estiver definido ou estiver true, o encaminhamento produzirá o erro XA1044 que interrompe a compilação.