Newtonsoft.json: Fin inattendue lors de la désérialisation de l'objet. Chemin ''

Créé le 9 déc. 2014  ·  3Commentaires  ·  Source: JamesNK/Newtonsoft.Json

Je reçois cette erreur lors de la désérialisation.
Voici mes paramètres pour le sérialiseur :

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();

La sérialisation se passe bien, mais lors de la désérialisation, je reçois cette erreur. Est-ce que j'ai raté quelque chose ?

Plateforme : Windows 8.1, WinRT,
Json version 6.0.6.

Tous les 3 commentaires

Désolé, c'est ma faute. Le problème est déjà résolu.

Comment avez-vous résolu cela ?

Demander la même chose que ci-dessus...

Cette page vous a été utile?
0 / 5 - 0 notes