New .Net 2.0 Version Tolerant Serialization

  • Thread starter Thread starter Dennis C. Drumm
  • Start date Start date
D

Dennis C. Drumm

I am trying to work with VTS and was looking at the example provided by MSDN
docs

ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxsamples/html/2a183664-bfbf-4ff0-96f6-c836284ea916.htm

For some reason when I comment out the OptionalField attribute for the _age
field in the V2 application, a deserialazation exception is not being thrown
when it is run.

Can someone tell me why?

Thanks,

Dennis
 
Hi Dennis,

Welcome to MSDN newsgroup.
As for this binary deserializing with VTS model question, we'll peform some
tests on our side and will update you as soon as possible.
Thanks for your understanding....

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
| From: "Dennis C. Drumm" <[email protected]>
| Subject: New .Net 2.0 Version Tolerant Serialization
| Date: Sun, 4 Dec 2005 13:20:57 -0500
| Lines: 16
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <#5FB89P#[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: vsat-148-63-14-234.c001.g4.mrt.starband.net
148.63.14.234
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.languages.csharp:369299
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| I am trying to work with VTS and was looking at the example provided by
MSDN
| docs
|
|
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxsamples/html/2
a183664-bfbf-4ff0-96f6-c836284ea916.htm
|
| For some reason when I comment out the OptionalField attribute for the
_age
| field in the V2 application, a deserialazation exception is not being
thrown
| when it is run.
|
| Can someone tell me why?
|
| Thanks,
|
| Dennis
|
|
|
 
Hi Dennis,

I downloaded VTS and comment out the OptionalField attribute. And I can
reproduce this. Based on my research, this behavior is by design. It was
added at the RTM build in order not to deviate from the .NET framework 1.1
behavior.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Thanks Kevin,

That raises a few more questions.

First, for versioning, do we still need to use the OptionalField attribute
for fields in prior versions that will no longer be serialized and do we
need to use it for new fields that will now be serialized that don't show up
in older versions?

And if we do need to use the OptionalField attribute for those fields, then
what are the consequences of not using it?

Thanks,

Dennis
 
Hi Dennis,

In .NET 2.0, we are encouraged to use the OptionalField attribute for the
fields you have mentioned. The exceptions are not thrown, because of the
backward compatibility issues. I think in the future versions of .NET
framework, the rules will be more strict in serialization.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top