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# - 压缩现有 XPS 文档

c# - 微软下的正则表达式

ios - 删除 NSUserDefaults 到对应的 UITableViewCell

ios - Scenekit:为什么我的相机看不到远处的物体?

android - xamarin表单上的“Can' t Write”错误

c# - 如何在数据对象中收集数据集?

ios - 如何在 Swift 4 中测试 API?

ios - 当 iOS 应用程序在 Xamarin 中作为后台时,如何通知我蓝牙连接?

xamarin - MvvmCross 在应用程序开始时崩溃 "Method ' Array.Empty' not found”异常

c# - 查找总和为指定目标数的所有数字(整数分区)