c# - xamarin 意图扩展与 netstandard 导致 MT2001 错误

标签 c# ios xamarin xamarin.ios intents-extension

我正在尝试将 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

要清楚的是,我的项目结构

projectstructure

link to project

最佳答案

解决了这个问题。 显式添加对 System.Drawing.Common 和 MvvmCross 的 nuget 引用。 问题出在 System.Drawing.Common 中,VS 正在尝试使用 GAC 版本。通过 nuget 引用,它使用 .net 标准版本。

关于c# - xamarin 意图扩展与 netstandard 导致 MT2001 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58474823/

相关文章:

c# - 通过 Foreach 什么时候可以修改?

c# - 通用接口(interface)具体类型之间没有隐式引用转换错误

c# - 在 asp.net 中的 ASPX 页面上创建表单

c# - 使用 OpenXML 替换 DOCX 文件中的文本 - 奇怪的内容

ios - 为什么我必须使用 self.引用自己的对象

ios - 如何使用 if 语句将一种类型的变量设置为特定类型的自定义 tableCell?

ios - 如何限制 UITextView 中的行数?

c# - Xamarin 在方向更改时形成内存不足错误

ios - 如何在xamarin中退出firstresponder触摸 ScrollView

c# - Xamarin MonoMac 在主窗口上预览网络摄像头 ( AVCaptureVideoPreviewLayer )