简体   繁体   中英

Json.NET Windows Store App certification crash

This might not be related 100% to Json.NET but since it's the component that crashes...

The serialization works just fine until the second test of the Windows App Cert Kit. Starting with this app launch it throws the following exception:

System.EntryPointNotFoundException Entry point was not found.
at Newtonsoft.Json.Utilities.ReflectionUtils.GetFieldsAndProperties(Type type, BindingFlags bindingAttr) in \Newtonsoft.Json\Utilities\ReflectionUtils.cs:line 661
at Newtonsoft.Json.Serialization.DefaultContractResolver.GetSerializableMembers(Type objectType) in \Newtonsoft.Json\Serialization\DefaultContractResolver.cs:line 267
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateProperties(Type type, MemberSerialization memberSerialization) in \Newtonsoft.Json\Serialization\DefaultContractResolver.cs:line 845
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract(Type objectType) in \Newtonsoft.Json\Serialization\DefaultContractResolver.cs:line 349
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType) in \Newtonsoft.Json\Serialization\DefaultContractResolver.cs:line 734
at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type) in \Newtonsoft.Json\Serialization\DefaultContractResolver.cs:line 232
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.GetContractSafe(Object value) in \Newtonsoft.Json\Serialization\JsonSerializerInternalWriter.cs:line 77
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value) in \Newtonsoft.Json\Serialization\JsonSerializerInternalWriter.cs:line 58
at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value) in \Newtonsoft.Json\JsonSerializer.cs:line 608
at Newtonsoft.Json.JsonConvert.SerializeObject(Object value, Formatting formatting, JsonSerializerSettings settings) in \Newtonsoft.Json\JsonConvert.cs:line 749

The code looks like this...

var test = JsonConvert.SerializeObject(new { id = "a", test = "test" });

After running WACK on the app I have to reinstall it to make it work again.

Does anyone know how WACK runs the app? I suppose it somehow simultates various environments at each launch but I can't find out how it messes my app.

The problem is caused by Json.NET using an anonymous type in GetFieldsAndProperties. WinRT must have a bug with them when used in a third party dll.

Sorry, my fault. I confirm it's fixed in the Release 7

I opened a bug on Connect, because this is a blocking issue for using the grate JSNO.Net on Windows 8 Metro.

https://connect.microsoft.com/VisualStudio/feedback/details/749011/ngen-failing-with-json-net-metro

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM