範例訊息
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
Issue
NativeAOT 是一個針對 Android .NET 的實驗性執行環境選項。 當你透過 $(PublishAot)=true啟用 NativeAOT 時,會發出此警告,表示 NativeAOT 尚未適合用於生產環境。
支援的執行時期有:
- CoreCLR(預設)
- MonoVM 使用
$(UseMonoRuntime)=true,
解決方案
為了讓這個警告安靜下來,你可以選擇:
請移除專案檔案中的
$(PublishAot)=true以使用支援的執行環境。在你的專案檔案中設定
$(EnablePreviewFeatures)為 ,true以確認 NativeAOT 的實驗性質。