K
KWienhold
I have been working with serialization in some places for a while and
have now begun to run into version issues.
Unfortunately my company is still working with .Net 1.1, so using the
VTS of 2.0 was not an option.
So I decided to have my classes implement ISerializable and wrote a
set of functions that use reflection and mimick version tolerant
serialization.
Unfortunately the only way to determine wether a field exists in a
SerializationInfo is to try to access it and catch the
SerializationException if it occurs.
Because of the nature of try/catching, this process can be rather slow
(especially when an old version is lacking many of the expected
fields), so I have been wondering why there is no way to determine
beforehand wether a certain field exists within a SerializationInfo.
I tried finding an answer on google, but to no avail, so I'm just
wondering wether any of you guys know?
Sincerely,
Kevin Wienhold
have now begun to run into version issues.
Unfortunately my company is still working with .Net 1.1, so using the
VTS of 2.0 was not an option.
So I decided to have my classes implement ISerializable and wrote a
set of functions that use reflection and mimick version tolerant
serialization.
Unfortunately the only way to determine wether a field exists in a
SerializationInfo is to try to access it and catch the
SerializationException if it occurs.
Because of the nature of try/catching, this process can be rather slow
(especially when an old version is lacking many of the expected
fields), so I have been wondering why there is no way to determine
beforehand wether a certain field exists within a SerializationInfo.
I tried finding an answer on google, but to no avail, so I'm just
wondering wether any of you guys know?
Sincerely,
Kevin Wienhold