Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Binary deserialization to changed class
Message
De
06/07/2011 12:04:21
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Binary deserialization to changed class
Versions des environnements
Environment:
C# 4.0
Divers
Thread ID:
01517444
Message ID:
01517444
Vues:
100
Hi,

Can someone check me on this:

I have a class that has been serialized to a data store using binary serialization.
This : http://msdn.microsoft.com/en-us/library/ms229752.aspx implies that I should be able to deserialize this to a modified class.
I added the following Property to the class:
[OptionalField]
        private bool trackTweaks = true;
        public bool TrackTweaks
        {
            get{return trackTweaks;}
            set { trackTweaks = value; }
        }
The BinarySerializer.Deserialize() now throws a "Method 'get_TrackTweaks' in type xxx from assembly yyy does not have an implementation." exception.
My understanding is that the BinarySerializer only serializes fields. Why would it throw an error related to the TrackTweaks accessor?

UPDATE: I think I was premature in my analysis. A quick check seems to indicate that I get the same exception even when deserializing from the updated class. Something more subtle must be happening......
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform