Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binary deserialization to changed class
Message
From
06/07/2011 12:04:21
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Binary deserialization to changed class
Environment versions
Environment:
C# 4.0
Miscellaneous
Thread ID:
01517444
Message ID:
01517444
Views:
99
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......
Next
Reply
Map
View

Click here to load this message in the networking platform