示例消息
warning XA1040: The NativeAOT runtime on Android is an experimental feature and not yet suitable for production use. File issues at: https://github.com/dotnet/android/issues
問题
NativeAOT 是适用于 Android 的 .NET 的实验性运行时选项。 通过 $(PublishAot)=true启用 NativeAOT 时,发出此警告以指示 NativeAOT 尚不适合生产使用。
支持的运行时包括:
- CoreCLR (默认值)
- 通过
$(UseMonoRuntime)=true使用的 MonoVM
解决方案
若要静音此警告,可以:
使用受支持的运行时,请通过从项目文件中删除
$(PublishAot)=true。将
$(EnablePreviewFeatures)设置为true以在项目文件中确认 NativeAOT 的实验性质。