.NET voor Android-waarschuwing XA1029

Voorbeeldberichten

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.

Probleem

Deze waarschuwing wordt gegenereerd wanneer $(AotAssemblies) is opgegeven, ook wanneer het is ingesteld op false.

Solution

Voor ondersteunde .NET 10-en-eerdere projecten die Mono gebruiken, in plaats van:

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

Gebruik in plaats daarvan:

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

Verwijder voor CoreCLR- of NativeAOT-projecten $(AotAssemblies) zonder toe te voegen $(RunAOTCompilation). Deze runtimes maken geen gebruik van de Mono AOT-pijplijn. Als $(AotAssemblies)true is terwijl $(RunAOTCompilation) niet is ingesteld of true is, veroorzaakt het doorsturen de fout XA1044 waardoor de build stopt.