无法在 Xamarin.iOS 上对 Microsoft.CSharp.dll 的程序集进行 AOT

Could not AOT the assembly for Microsoft.CSharp.dll on Xamarin.iOS

当我尝试构建我的 Xamarin iOS 项目时,出现错误: “无法 AOT 程序集 '/Users/xxx/Library/Caches/Xamarin/mtbs/builds/myApp.iOS/hugeNumbers/obj/iPhone/Debug/mtouch-cache/3-Build/Microsoft.CSharp.dll' “

我在其他一些帖子中发现这是由于软件包 Newtonsoft.Json 造成的,但它应该在不久前就已修复。

我正在尝试在 Visual Studio 2019 Windows 上构建我的项目,与我的 Mac 同步以便在 iPhone 上启动。

有什么帮助吗?

试试这个: 删除 phone 或模拟器上的应用程序。 清洁和重建解决方案。 重新部署。

感谢 Lex Li,以下是使它对我有用的步骤:

1- 从 here 下载 AOT 安装程序(适用于 Visual Studio 2019 和 Visual Studio 适用于 Mac 8.0

2- 启动安装程序并按照步骤进行操作

3- 在您的项目 Xamarin.iOS (myApp.iOS) 上,右键单击 > 设置

4- 转到构建 iOS,然后在页面底部的附加 mtouch 参数部分添加“--interpreter”

5- 再次构建,它应该可以工作。

<MtouchExtraArgs>--interpreter=FSharp.Core ...</MtouchExtraArgs>
<MtouchInterpreter>-all</MtouchInterpreter>

<MtouchExtraArgs>--linkskip=FSharp.Core ...</MtouchExtraArgs>

都在 https://github.com/xperiandri/Elmish.Uno/

为我工作