Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2006

Tip: Looking for answers? Try searching our database.

System.Version

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex Clark - 27 Jul 2006 15:49 GMT
Hi All,

I've searched the documentation and Google for an answer to this but to no
avail.

It seems that System.Version does not serialize to XML.  I checked the
documentation and this type is flagged as being Serializable, it has a
default parameterless constructor, and I'm pretty sure it can be binarily
serialized without a problem.

On my example class I have a field as follows:

Public MyVersion As System.Version

I initialise this to a new System.Version(5,5,5,5) before serializing.
After serializing it to an XML file using the XMLSerializer class all I get
in my XML doc is "<MyVersion />" - this seems to imply that none of the
fields in the System.Version class can be serialized into XML?

Can anyone confirm this?

Thanks,
Alex Clark
Jay B. Harlow [MVP - Outlook] - 27 Jul 2006 19:50 GMT
Alex,
I would not expect System.Version to be Xml serializable as it doesn't have
any read/write public properties. It only has read only public properties.

Nor does it implement IXmlSerializable.

To be Xml serializable it needs to implements IXmlSerializable or (and?) it
need to have public read/write properties.

The Serializable attribute only controls if its Binary serializable...

Signature

Hope this helps
Jay B. Harlow [MVP - Outlook]
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net

| Hi All,
|
[quoted text clipped - 19 lines]
| Thanks,
| Alex Clark

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.