Newtonsoft.json: オブジェクトを逆シリアル化するときに予期しない終了が発生しました。 道 ''

作成日 2014年12月09日  ·  3コメント  ·  ソース: JamesNK/Newtonsoft.Json

デシリアライズ中にこのエラーが発生します。
シリアライザーの設定は次のとおりです。

class CustomContractResolver : DefaultContractResolver
   {
      public new static readonly CustomContractResolver Instance = new CustomContractResolver();


      protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
      {
         JsonProperty property = base.CreateProperty(member, memberSerialization);
         if (property.DeclaringType == typeof(Vector3))
         {
            property.Ignored = true;
         }
         return property;
      }

      protected override JsonContract CreateContract(Type objectType)
      {
         if (objectType.GetInterfaces().Any(i => i == typeof(IDictionary) ||
            (i.IsGenericType &&
             i.GetGenericTypeDefinition() == typeof(IDictionary<,>))))
         {
            return base.CreateArrayContract(objectType);
         }
         return base.CreateContract(objectType);
      }
   }
        JsonSerializerjson = new JsonSerializer();
         json.Formatting = Formatting.Indented;
         json.ObjectCreationHandling = ObjectCreationHandling.Reuse;
         json.NullValueHandling = NullValueHandling.Ignore;
         json.StringEscapeHandling = StringEscapeHandling.Default;
         json.ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor;
         json.TypeNameHandling = TypeNameHandling.Objects;
         json.DefaultValueHandling = DefaultValueHandling.Ignore;
         json.PreserveReferencesHandling = PreserveReferencesHandling.All;
         json.ReferenceLoopHandling = ReferenceLoopHandling.Serialize;
         json.ContractResolver = new CustomContractResolver();
         serializer = new global::AdamantiumSerializer.AdamantiumSerializer();

シリアル化はうまくいきますが、逆シリアル化中にそのエラーが発生します。 私は何かが足りないのですか?

プラットフォーム:Windows 8.1、WinRT、
Jsonバージョン6.0.6。

全てのコメント3件

申し訳ありませんが、これは私のせいです。 問題はすでに解決されています。

これをどのように解決しましたか?

上記と同じ質問...

このページは役に立ちましたか?
0 / 5 - 0 評価