wojtpl2 - ExtendedXmlSerializer 2.0.0
Extended Xml Serializer for .NET
PM> Install-Package ExtendedXmlSerializer -Version 2.0.0 -Source https://www.myget.org/F/wojtpl2/api/v3/index.json
> nuget.exe install ExtendedXmlSerializer -Version 2.0.0 -Source https://www.myget.org/F/wojtpl2/api/v3/index.json
> dotnet add package ExtendedXmlSerializer --version 2.0.0 --source https://www.myget.org/F/wojtpl2/api/v3/index.json
source https://www.myget.org/F/wojtpl2/api/v3/index.json
nuget ExtendedXmlSerializer ~> 2.0.0
Copy to clipboard
> choco install ExtendedXmlSerializer --version 2.0.0 --source https://www.myget.org/F/wojtpl2/api/v2
Import-Module PowerShellGet
Register-PSRepository -Name "wojtpl2" -SourceLocation "https://www.myget.org/F/wojtpl2/api/v2"
Install-Module -Name "ExtendedXmlSerializer" -RequiredVersion "2.0.0" -Repository "wojtpl2"
Copy to clipboard
ExtendedXmlSerializer
Welcome!
Welcome to ExtendedXMLSerializer's GitHub repository. Here you will find a .NET serializer that:
- Specializes in POCO-based object graph serialization
- Features a powerful extension model
- Operates in the tried-and-trusted dependable XML format. π
"But why?"
The classic System.Xml.XmlSerializer
poses some challenges:
- Does not support properties that are defined with interface types
- Does not support read-only collection properties (like Xaml does)
- Does not support parameterized constructors (immutable objects)
- Does not support private constructors
- Does not support serialization of class with circular reference or class with interface property
- If you want create custom serializer, your class must inherit from
IXmlSerializable
orISerializable
. This takes the "plain" out of POCO. π - No migration mechanism for XML based on older code model
ExtendedXmlSerializer addresses a lot of these problems and much much more!
- Serializes and deserializes pretty much any POCO you throw at it*:
class
,struct
, generics, primitives, genericList
andDictionary
,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. - Custom serializer registration by type or member
- Serialization of references, handling circular references without endlessly looping
- All configurations (migrations, custom serializer...) are outside the class and not coupled to attributes or messy, arcane conventions
- Migrate old XML based on an older schema to a current schema
- Property encryption
- Support
XmlElementAttribute
,XmlRootAttribute
, andXmlTypeAttribute
for identity resolution - Additional attribute support:
XmlIgnoreAttribute
,XmlAttributeAttribute
, andXmlEnumAttribute
- Deserialization xml from classic
XmlSerializer
(mostly, details in FAQ)
(*Yes, this even -- and especially -- means classes with properties that have an interface property type!)
Supported platforms:
- .NET Standard 2.0
- .NET 4.5.2 (as of #273)
Usage
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.
Installation
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
Known Issues
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.
Featured Documentation
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.
- API Reference
- Concepts and Topics (Mirror of our wiki above)
(Looking to upgrade from 1.x? We got you covered here.)
Want to Contribute?
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.
Notable Contributors
- Wojciech NagΓ³rski - v1.x Author.
- Mike-E-angelo - v2.x+ Author.
Mentions
ExtendedXmlSerializer is proudly developed and maintained with ReSharper Ultimate.
- Engine rewrite
- Introduces extensibility model
- Lots (!) of extensions
- New configuration API
- Bug fixes
- ... and much much more!
-
.NETStandard 2.0
- JetBrains.Annotations (>= 11.1.0)
- Newtonsoft.Json (>= 11.0.1-beta1)
- System.Collections.Immutable (>= 1.4.0)
- System.ComponentModel (>= 4.3.0)
- System.Interactive (>= 3.1.1)
- System.Reflection.Emit.Lightweight (>= 4.3.0)
- System.Xml.XmlSerializer (>= 4.3.0)
- .NETStandard 2.0: 2.0.0.0
Ownerswojtpl2 |
AuthorsWojciech Nagórski, Michael DeMond |
Project URLhttps://github.com/wojtpl2/ExtendedXmlSerializer |
LicenseMIT |
Tagsxmlserializer xmlserialization serialization ExtendedXmlSerializer xml |
Info68 total downloads |
2 downloads for version 2.0.0 |
Download (196.02 KB) |
Found on the current feed only |
Package history
Version | Size | Last updated | Downloads | Mirrored? | |||
---|---|---|---|---|---|---|---|
2.1.25 | 692.97 KB | Fri, 08 Nov 2019 16:49:50 GMT | 2 | ||||
2.1.24 | 690.72 KB | Fri, 08 Nov 2019 15:43:52 GMT | 3 | ||||
2.1.23 | 684.22 KB | Fri, 27 Sep 2019 13:45:52 GMT | 2 | ||||
2.1.22 | 686.52 KB | Wed, 25 Sep 2019 14:52:04 GMT | 2 | ||||
2.1.21 | 681.81 KB | Wed, 17 Jul 2019 07:05:47 GMT | 2 | ||||
2.1.20 | 681.22 KB | Mon, 08 Jul 2019 10:52:13 GMT | 1 | ||||
2.1.19 | 677.99 KB | Wed, 19 Jun 2019 18:38:57 GMT | 1 | ||||
2.1.18 | 677.73 KB | Mon, 13 May 2019 13:54:56 GMT | 1 | ||||
2.1.17 | 658.61 KB | Tue, 12 Mar 2019 18:24:42 GMT | 1 | ||||
2.1.16 | 657.17 KB | Wed, 13 Feb 2019 06:21:53 GMT | 2 | ||||
2.1.15 | 651.79 KB | Tue, 08 Jan 2019 12:11:19 GMT | 2 | ||||
2.1.14 | 651.61 KB | Sat, 24 Nov 2018 07:25:31 GMT | 1 | ||||
2.1.13 | 442.45 KB | Fri, 26 Oct 2018 07:19:37 GMT | 1 | ||||
2.1.12 | 440.98 KB | Wed, 17 Oct 2018 04:22:13 GMT | 1 | ||||
2.1.11 | 440.98 KB | Tue, 16 Oct 2018 06:46:43 GMT | 6 | ||||
2.1.10 | 438.45 KB | Mon, 08 Oct 2018 15:59:28 GMT | 3 | ||||
2.1.9 | 438.42 KB | Wed, 03 Oct 2018 19:32:18 GMT | 2 | ||||
2.1.8 | 438.33 KB | Thu, 20 Sep 2018 14:10:37 GMT | 4 | ||||
2.1.7 | 436.77 KB | Thu, 13 Sep 2018 17:12:52 GMT | 2 | ||||
2.1.6 | 436.77 KB | Mon, 10 Sep 2018 18:07:14 GMT | 2 | ||||
2.1.5 | 436.48 KB | Wed, 29 Aug 2018 14:05:46 GMT | 1 | ||||
2.1.3 | 434.65 KB | Sat, 25 Aug 2018 08:13:36 GMT | 1 | ||||
2.1.2 | 427.73 KB | Tue, 17 Apr 2018 06:24:11 GMT | 1 | ||||
2.1.1 | 405.27 KB | Sun, 04 Feb 2018 23:27:57 GMT | 3 | ||||
2.1.0 | 402.18 KB | Thu, 01 Feb 2018 10:56:28 GMT | 1 | ||||
2.0.1 | 402.51 KB | Wed, 31 Jan 2018 07:55:23 GMT | 2 | ||||
2.0.0 | 196.02 KB | Fri, 26 Jan 2018 14:47:18 GMT | 2 | ||||
2.0.0-alpha7 | 383.93 KB | Tue, 14 Nov 2017 12:40:22 GMT | 2 | ||||
2.0.0-alpha6 | 380.87 KB | Tue, 03 Oct 2017 15:54:07 GMT | 1 | ||||
2.0.0-alpha5 | 375.01 KB | Wed, 30 Aug 2017 07:51:55 GMT | 1 | ||||
2.0.0-alpha4 | 373.19 KB | Thu, 10 Aug 2017 16:05:48 GMT | 1 | ||||
2.0.0-alpha3 | 370.02 KB | Wed, 19 Apr 2017 10:41:06 GMT | 2 | ||||
2.0.0-alpha | 370 KB | Tue, 11 Apr 2017 09:16:21 GMT | 2 | ||||
1.5.0 | 32.15 KB | Mon, 27 Feb 2017 14:48:41 GMT | 2 | ||||
1.4.1 | 32.15 KB | Tue, 06 Dec 2016 08:22:13 GMT | 1 | ||||
1.4.0 | 28.57 KB | Fri, 18 Nov 2016 09:33:11 GMT | 1 | ||||
1.3.0 | 27.32 KB | Tue, 18 Oct 2016 08:19:47 GMT | 1 | ||||
1.2.0 | 27.31 KB | Tue, 18 Oct 2016 07:11:21 GMT | 1 | ||||
1.1.1 | 25.42 KB | Thu, 22 Sep 2016 11:56:57 GMT | 1 | ||||
1.1.0 | 24.07 KB | Wed, 14 Sep 2016 11:46:16 GMT | 0 | ||||
1.0.1 | 24.08 KB | Wed, 31 Aug 2016 07:18:45 GMT | 0 | ||||
1.0.0 | 23.95 KB | Tue, 30 Aug 2016 13:15:47 GMT | 0 |