[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

Version tolerant (De)serialization

MikeNET

5/23/2008 3:32:00 AM

In .NET 2.0 great strives have been made to make binary serialization more
version tolerant, with new or removed fields no longer throwing exceptions.
Although one scenario remains that keeps throwing an exception... when the
type of a field has changed. Using OptionalFieldAttribute one can indicate
to omit during deserialization a new field, if the data for that field is
_not present_ in the old stream.

Is there any declarative (such as TypeConverterAttribute) or imperative
mechanism to handle situations when the type of the field has changed, to
prevent exception from throwing when data type of one or more fields has
changed? Essentially to ignore reading data for fields that have different
type between definition in old serialized stream and new definition in
assembly.

Thanks in advance