.NET Android 版警告:XA2000

你的 Android 應用程式所使用的功能會在未來的 .NET 版本中消失。

範例訊息

Use of AppDomain.CreateDomain() detected in assembly: {assembly}. .NET 6 will only support a single AppDomain, so this API will no longer be available in .NET for Android once .NET 6 is released.

注意:這個錯誤會對應到 IL6200 .NET 6 及以上版本。

Support for the 'MONO_GC_PARAMS=bridge-implementation=old' value will be removed in .NET 7.

解決方法

遷移離被移除的功能。

將程式碼從 AppDomain.CreateDomain() 轉換為其他 API,例如 AssemblyLoadContext

請將程式碼從MONO_GC_PARAMS=bridge-implementation=old 中轉換。