Eric's Blog

Day to day experience in .NET
Welcome to Blogs @ IRM Sign in | Join | Help
 Search

Disclaimer

The content of this site is my own personal opinion and does not in any way represent my employer, it's subsideries or affiliates. These postings are provided "AS IS" with no warranties, and confer no rights.

This Blog

The Small Things: XmlSerializer

The XmlSerializer has some minor, but great new features. A while ago I blogged about how it is possible to affect serialization by creating a class that inherits from SchemaImporterExtension. Another useful feature is the possibility to create an XML serialization assembly in advance, instead of that assembly being created in run-time by the framework as it was in .Net 1.0 and 1.1. This feature will improve startup performance of the XmlSerializer. The tool to create the XML serialization assemblies with, is sgen.exe. This feature is also exposed in the project properties of the C# and VB projects, but it's not working as it should. This bug I guess (or hope) is being fixed in SP1 though.
The possibility to create XML serialization assemblies is at least somewhat known, but another thing that I did not know until I discovered it just recently is the improvements in the generated schemas created by XmlSerializer. I have noticed two improvements; 1) enums is created as enums in the schema and 2) GUIDs gets a regular expression restriction on it. This is great I think and maps more closely to what you would have done if you use contract first techniques to create the schema first.
 
Published den 25 oktober 2006 09:06 by ericqu

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server, by Telligent Systems