.net - 在 Xamarin iOS 中使用 .NET 标准

标签 .net xamarin xamarin.ios .net-standard typeloadexception

我在我的 Xamarin iOS 项目中添加了对 .NET 标准库 (1.3) 的引用。

在运行时,当我创建 .NET 标准库中定义的类的实例时,它会抛出此异常:

Unhandled Exception:

System.TypeLoadException: Could not find method due to a type load error

例如,当我这样做时,就会发生这种情况:

var c = new Customer();

发生了什么事以及如何解决它?

最佳答案

最后我做到了:问题是我必须包含传递引用。也就是说,我的项目 A 引用 B,B 引用 C。所以我必须包含 A => C。这不是很明显。我还必须包含我的引用使用的所有 NuGet 包。立即构建并运行!

关于.net - 在 Xamarin iOS 中使用 .NET 标准,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44384752/

相关文章:

.net - System.Security.Permissions.DataProtectionPermissionAttribute 的使用

c# - 来自服务器的响应的 .NET header

.net - 使用云计算作为开发环境

Android 模拟器 - 无法截图 - 不支持的协议(protocol) : 2

c# - 如何在 Xamarin 中查找当前的 UIViewController

xamarin - 如何在 iOS 中的 Xamarin 按钮上将图像左对齐并将文本对齐到中心?

c# - C# 的 F# Xml TypeProvider

android - 如何在Xamarin Studio中调试小部件应用程序?

android - Xamarin PCLStorage 包 : What is the root folder this PCLStorage reference to

ios - 加载通用类型在模拟器中有效,但在设备中无效