使用时
var obj = JsonConvert.DeserializeObject(soapResponse);
它没有为obj分配值。
它与xamarin android正常工作。但显示xamarin ios的错误。
{System.TypeLoadException:无法从程序集'mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'加载类型'System.Reflection.Emit.DynamicMethod'。 at Newtonoft.Json.Serialization.DefaultContractResolver.GetDefaultCreator(System.Type createdType)[0x00000]在c:\ Development \ Releases \ Json \ Working \ Newtonsoft.Json \ Src \ Newtonsoft.Json \ Serialization \ DefaultContractResolver.cs:685 在牛逼C:\ Development \ Releases \ Json \ Working \ Newtonsoft.Json \ Src \ Newtonsoft.Json \ Serialization \ DefaultContractResolver.cs中的Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract(Newtonsoft.Json.Serialization.JsonContract contract)[0x0008b] :716 在C:\ Development \ Releases \ Json \ Working \ Newtonsoft.Json \ Src \ Newtonsoft.Json \ Serialization \ DefaultContractResolver.cs中的Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract(System.Type objectType)[0x00007]中:361 at Newtonoft.Json.Serialization.DefaultContractResolver.CreateContract(System.Type objectType)[0x00100]在c:\ Development \ Releases \ Json \ Working \ Newtonsoft.Json \ Src \ Newtonsoft.Json \ Serialization \ DefaultContractResolver.cs:1013 在C:\ Development \ Releases \ Json \ Working \ Newtonsoft.Json \ Src \ Newtonsoft.Json \ Serialization \ DefaultContractResolver.cs中的Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(System.Type type)[0x0003e]中:242 在C:\ Development \ Releases \ Json \ Working \ Newtonsoft.Json \ Src \ Newtonsoft.Json \ Serialization \ JsonSerializerInternalReader.cs中的Newtonsoft.Json.Serialization.JsonSerializerInternalReader.GetContractSafe(System.Type type)[0x0000b]中:130 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(Newtonsoft.Json.JsonReader读卡器,System.Type的的objectType,布尔checkAdditionalContent)[0x0000e]在C:\发展\发布\的Json \工作\ Newtonsoft.Json \ SRC \ Newtonsoft.Json \序列化\ JsonSerializerInternalReader.cs:138 在Newtonoft.Json.JsonSerializer.DeserializeInternal(Newtonsoft.Json.JsonReader reader,System.Type objectType)[0x00047]在c:\ Development \ Releases \ Json \ Working \ Newtonsoft.Json \ Src \ Newtonsoft.Json \ JsonSerializer.cs中: 710 at Newtonoft.Json.JsonSerializer.Deserialize(Newtonsoft.Json.JsonReader reader,System.Type objectType)[0x00000]在c:\ Development \ Releases \ Json \ Working \ Newtonsoft.Json \ Src \ Newtonsoft.Json \ JsonSerializer.cs: 689 at Newtonsoft.Json.JsonConvert.DeserializeObject(System.String值,System.Type类型,Newtonsoft.Json.JsonSerializerSettings设置)[0x0002d]在c:\ Development \ Releases \ Json \ Working \ Newtonsoft.Json \ Src \ Newtonsoft.Json中\ JsonConvert.cs:846 在Newtonoft.Json.JsonConvert.DeserializeObject [Object](System.String值,Newtonsoft.Json.JsonSerializerSettings设置)[0x00000]在c:\ Development \ Releases \ Json \ Working \ Newtonsoft.Json \ Src \ Newtonsoft.Json \ JsonConvert的.cs:805 at Newtonoft.Json.JsonConvert.DeserializeObject [Object](System.String value)[0x00000]在c:\ Development \ Releases \ Json \ Working \ Newtonsoft.Json \ Src \ Newtonsoft.Json \ JsonConvert.cs:742 在TrxServices.Views.Login + d__21.MoveNext()[0x00372]在d:\ DAta D Drive \ SelfDemo \ TrxServices \ TrxServices \ TrxServices \ Views \ Login.cs:300}
答案 0 :(得分:0)
根据Xamarin iOS的限制,根据Jason的评论,这不受支持: -
http://developer.xamarin.com/guides/ios/advanced_topics/limitations/