xamarin - 更新 Nuget 导致异常未处理 : System. TypeLoadException

标签 xamarin xamarin.forms xamarin.android visual-studio-2017 nuget-package

我正在启动一个新的 xamarin 主页面用于测试目的,并更新了 xamarin.android.support 和 xamarin.forms 版本的 nuget 包。之后,我的程序出现异常:

LoadApplication获取异常错误:

    base.OnCreate(savedInstanceState);
    global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
    LoadApplication(new App());


Unhandled Exception:

System.TypeLoadException: Could not load type of field 'Xamarin.Forms.Platform.Android.RendererPool:_freeRenderers' (0) due to: Could not resolve type with token 01000275 from typeref (expected class 'System.Collections.Generic.Stack`1' in assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e') assembly:mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e type:System.Collections.Generic.Stack`1 member:(null) occurred

最佳答案

将所有项目中的 xamarin.forms 和 xamarin.forms.maps 降级到 v4.1.0.778454。

我做到了,而且效果很好

关于xamarin - 更新 Nuget 导致异常未处理 : System. TypeLoadException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58032635/

相关文章:

c# - MonoDroid 值得付出努力吗?

ios - 创建旋转动画

mono - 构建失败。找不到类型 'System.Globalization.SortVersion'

ios - 如何将 QR 码图像传递给 Apple Watch

android - Mono.Linker.MarkException : Error processing method: 'System. 无效 AndroidX.RecyclerView.Widget.RecyclerView/LayoutManager

android - 如何使用 Xamarin Visual Studio 2015 构建 Android App Bundle?

android - 没有互联网连接的 Visual Studio Xamarin 和 Android 模拟器

c# - Xamarin.forms 中的点击手势

c# - Xamarin CollectionView 缓慢滚动

xamarin.forms - Xamarin 表单条目返回类型未按预期工作