百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
H

home

> 编程语言
开源

一个可配置和可扩展的 XML 序列化器,适用于 .NET。

343 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

一个可配置和可扩展的 XML 序列化器,适用于 .NET。

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 or ISerializable. 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, 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.
  • 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, and XmlTypeAttribute for identity resolution
  • Additional attribute support: XmlIgnoreAttribute, XmlAttributeAttribute, and XmlEnumAttribute
  • 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:

csharp
class Subject {
    public int Number { get; set; }
    public string Message { get; set; }
}

Configure, create, and serialize:

…

MAKE THE PRETTY XML!!!

(contents of the document variable above:)

xml

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.

    • The Basics
    • Features
    • API Overview
    • Example Scenarios
  • 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.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#custom-serializercustomizationdotnetextensibility

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言