473,396 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

New .Net 2.0 Version Tolerant Serialization

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
Dec 4 '05 #1
4 1732
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" <dc******@community.nospam>
| 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: <#5**************@TK2MSFTNGP11.phx.gbl>
| 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!TK2MSFT NGP11.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
|
|
|

Dec 5 '05 #2
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."

Dec 6 '05 #3
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


"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:cF*****************@TK2MSFTNGXA02.phx.gbl...
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."

Dec 6 '05 #4
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."

Dec 7 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Keith | last post by:
Is there a function for comparing version numbers? E.g. 0.1.0 < 0.1.2 1.876b < 1.876c 3.2.2 < 3.4 Keith
2
by: Joe Reazor | last post by:
I just upgraded to v1.1 of the framework and VS.Net 2003. I opened up one of my solutions and rebuilt my project and all went well. I then ran my project in debug mode. My program runs up fine,...
3
by: Joshua Moore | last post by:
I have a webservice that serializes a ton of variables and other good stuff to a txt file using SoapFormatter (IFormatter), and when I try to deserialize it using the binary formatter, i get the...
5
by: Lee Alexander | last post by:
hi, Perhaps someone can help me. I am trying to serialize an object but the serialization isn't working. I have created a small console app to show my problem. Perhaps someone with more...
2
by: Rohith | last post by:
I have a class which is serialized and stored in a file stream. Later I changed the class with adding some fields to it. Now when I deserialize (I am deserializing from a later version of my...
2
by: Doug Lind | last post by:
Hi all, I have seen a number of posts re: the BinaryFormatter version incompatibility but nothing on how to recover from it. In my case, I want the exception to trigger an alternate behaviour...
1
by: Dennis C. Drumm | last post by:
New for .net framework 2.0 is version tolerant serialization. To use this new feature, do I also need to use the new generics types for collections, e.g. SortedList? Thanks, Dennis
0
by: Michael | last post by:
I have a problem with serialization in my project. Serialization is working fine so far but when I increase the version of the application in the AssemblyInfo.cs I get an exception. So I created a...
3
by: =?Utf-8?B?TWFydGluIEtvY2g=?= | last post by:
1st I serialize a DataSet (contains 14 DataTables) into file, with BinaryFormatter. 2nd I change some columns in a DataTable. 3rd When I now Deserialize the DataSet from bin file got I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.