Welcome to ExtendedXMLSerializer's GitHub repository. Here you will find a .NET serializer that:
The classic System.Xml.XmlSerializer
poses some challenges:
IXmlSerializable
or ISerializable
. This takes the "plain" out of POCO. πExtendedXmlSerializer addresses a lot of these problems and much much more!
class
, struct
, generics, primitives, generic List
and Dictionary
, Array
, Enum
and much much more! If you find a class that doesn't get serialized, let us know and we'll take a look at it.XmlElementAttribute
, XmlRootAttribute
, and XmlTypeAttribute
for identity resolutionXmlIgnoreAttribute
, XmlAttributeAttribute
, and XmlEnumAttribute
XmlSerializer
(mostly, details in FAQ)(*Yes, this even -- and especially -- means classes with properties that have an interface property type!)
Supported platforms:
ExtendedXmlSerializer uses a ConfigurationContainer
to store configurations and extensions. Once this container is configured as desired, call its Create
method to create a serializer and serialize!
Example class:
class Subject {
public int Number { get; set; }
public string Message { get; set; }
}
Configure, create, and serialize:
IExtendedXmlSerializer serializer = new ConfigurationContainer().UseAutoFormatting()
.UseOptimizedNamespaces()
.EnableImplicitTyping(typeof(Subject))
// Additional configurations...
.Create();
var instance = new Subject {Message = "Hello World!", Number = 42};
var document = serializer.Serialize(new XmlWriterSettings {Indent = true},
instance);
MAKE THE PRETTY XML!!! πππ
(contents of the document
variable above:)
<?xml version="1.0" encoding="utf-8"?>
<Subject Number="42" Message="Hello World!" />
The above demonstrated code can be found in the form of a passing test within our test suite here.
From your favorite Package Manager Console:
Install-Package ExtendedXmlSerializer
Or if you are brave and want to try out our preview feed:
Install-Package ExtendedXmlSerializer -Source https://ci.appveyor.com/nuget/extendedxmlserializer-preview
While ExtendedXmlSerializer is very nice, it does have some known issues that have been identified by its owners. These issues are considered too significant to address and have been consolidated under a dedicated label for your review here:
https://github.com/ExtendedXmlSerializer/home/labels/known%20issue
Please review these issues before submitting a new issue and/or trialing ExtendedXmlSerializer.
Additionally, please note that ExtendedXmlSerializer is now essentially in maintenance mode as of March 2020. We will continue to monitor for any major bugs, so feel free to post an issue if you find one. However, major tasks and/or feature requests and the like will be deferred to the community.
FAQs - Probably the first place to go if you have a question.
Conceptual Topics - From our wiki.
Documentation Site - A resource deployed on every release.
(Looking to upgrade from 1.x? We got you covered here.)
We are a smaller project and are open to any contributions or questions. We do not have a formal code of conduct and would like to keep it that way.
If you view our FAQs and still have a question, open up a new issue! We'll do our best to meet you there with sample code to help get you on your way.
ExtendedXmlSerializer is proudly developed and maintained with ReSharper Ultimate.