Xamarin System.TypeLoadException:无法加载类型';System.Reflection.Emit.DynamicMethod';来自组件';mscorlib,

Xamarin System.TypeLoadException:无法加载类型';System.Reflection.Emit.DynamicMethod';来自组件';mscorlib,,xamarin,xamarin.forms,Xamarin,Xamarin.forms,使用时 var obj=JsonConvert.DeserializeObject(soapResponse) 它不是给obj赋值 它在xamarin android上运行良好,但在xamarin ios上显示错误 {System.TypeLoadException:无法从程序集'mscorlib,版本=4.0.0.0,区域性=中立,PublicKeyToken=b77a5c561934e089'加载类型'System.Reflection.Emit.DynamicMethod'。 在c:\De

使用时

var obj=JsonConvert.DeserializeObject(soapResponse)

它不是给obj赋值

它在xamarin android上运行良好,但在xamarin ios上显示错误

{System.TypeLoadException:无法从程序集'mscorlib,版本=4.0.0.0,区域性=中立,PublicKeyToken=b77a5c561934e089'加载类型'System.Reflection.Emit.DynamicMethod'。 在c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\DefaultContractResolver.GetDefaultCreator(System.Type createdType)[0x00000]中 位于c:\Development\Releases\Json\Working\Newtonsoft.Json.Json\Src\Newtonsoft.Json\Serialization\DefaultContractResolver.cs:716中的Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContact(Newtonsoft.Json.Serialization.jsonContractResolver)[0x0008b] 在c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\DefaultContractResolver.CreateObjectContract(System.Type objectType)[0x00007]中 在c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\DefaultContractResolver.CreateContract(System.Type objectType)[0x00100]中 在c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\DefaultContractResolver.ResolveContract(System.Type)[0x0003e]中 在c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\Json序列化\Json序列化\JsonSerializerInternalReader.cs:130中的Newtonsoft.Json.Serialization.JsonSerializerInternalReader.GetContractSafe(System.Type)[0x0000b] 在c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.Deserialize(Newtonsoft.Json.Json阅读器,System.Type objectType,Boolean checkAdditionalContent)[0x0000e]中 在c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\JsonSerializer.cs:710中的Newtonsoft.Json.JsonSerializer.DeserializeInternal(Newtonsoft.Json.JsonReader,System.Type objectType)[0x00047]处 在c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\JsonSerializer.cs:689中的Newtonsoft.Json.Json序列化程序[0x00000]处 在c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\JsonConvert.cs:846中的Newtonsoft.Json.JsonConvert.DeserializeObject(System.String值,System.Type类型,Newtonsoft.Json.Json序列化设置)[0x0002d]处 在c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\JsonSerializerSettings设置[0x00000]中的Newtonsoft.Json.Json反序列化对象[Object](System.String值,Newtonsoft.Json.Json序列化设置):805 在c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Json\JsonConvert.cs中的Newtonsoft.Json.JsonConvert.反序列化对象[Object](System.String值)[0x00000]处:742
在TrxServices.Views.Login+d_uu21.MoveNext()[0x00372]中的d:\DAta d Drive\SelfDemo\TrxServices\TrxServices\TrxServices\Views\Login.cs:300}

根据Xamarin iOS的限制,根据Jason的评论,这是不受支持的:-


iOS禁止动态代码生成,这限制了反射的使用。如果您正在对服务器的登录调用的响应进行反序列化,那么您的json是什么样子的?
反序列化对象是否与代码中的对象一样?因为它可能受益于类型参数。。。共享一些代码和数据,而不仅仅是堆栈跟踪