我正在启动一个新的 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/