我正在尝试将 Siri 意图添加到我的应用程序中。 我创建了意图扩展项目,而不是创建了 ios 库项目(如文档中的套件项目),它引用了具有共享逻辑(核心)的 .netstandard 项目。
核心项目使用 MvvmCross,当我尝试构建主应用程序时,它会导致:
error MT2001: Could not link assemblies. Reason: Error while processing references of 'Diabetto.iOS.Intents, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
通过更详细的日志,我知道了此错误的原因:
Error while processing references of 'Diabetto.iOS.Intents' ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'MvvmCross, Version=6.4.1.0, Culture=neutral, PublicKeyToken=null' ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'MvvmCross, Version=6.4.1.0, Culture=neutral, PublicKeyToken=null'
我尝试将 nuget 引用添加到 iOS 类库、iOS 意图库(不成功,出现错误
Failed to add reference. The package 'MvvmCross' tried to add a framework reference to 'System.Drawing.Common.dll' which was not found in the GAC
VS 2019 16.3.5,iOS 项目 13.1
要清楚的是,我的项目结构
最佳答案
解决了这个问题。 显式添加对 System.Drawing.Common 和 MvvmCross 的 nuget 引用。 问题出在 System.Drawing.Common 中,VS 正在尝试使用 GAC 版本。通过 nuget 引用,它使用 .net 标准版本。
关于c# - xamarin 意图扩展与 netstandard 导致 MT2001 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58474823/