CoreSystem.Serialization 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package CoreSystem.Serialization --version 1.0.0
                    
NuGet\Install-Package CoreSystem.Serialization -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CoreSystem.Serialization" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CoreSystem.Serialization" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CoreSystem.Serialization" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CoreSystem.Serialization --version 1.0.0
                    
#r "nuget: CoreSystem.Serialization, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CoreSystem.Serialization@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CoreSystem.Serialization&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CoreSystem.Serialization&version=1.0.0
                    
Install as a Cake Tool

⚡ CoreSystem.Serialization

Production-ready serialization abstraction for .NET 8

CoreSystem.Serialization provides a unified serialization abstraction for .NET applications, allowing you to switch between JSON, MessagePack, and Protocol Buffers without changing your application code. It integrates seamlessly with the Microsoft dependency injection container and exposes a consistent API across all supported serializers.

NuGet Downloads License .NET


✨ Features

  • ✅ Unified serialization API
  • ✅ JSON serialization
  • ✅ MessagePack serialization
  • ✅ Protocol Buffers serialization
  • ✅ Dependency Injection integration
  • ✅ Configurable serialization options
  • ✅ Common exception model
  • ✅ Lightweight and provider-agnostic design

📦 Installation

dotnet add package CoreSystem.Serialization

🚀 Quick Start

Register the framework:

builder.Services.AddCoreSerialization(options =>
{
    options.DefaultSerializer = SerializerType.Json;
});

Inject the serializer factory:

public sealed class ProductService(
    ISerializerFactory serializerFactory)
{
}

Resolve a serializer:

var serializer =
    serializerFactory.GetSerializer(
        SerializerType.Json);

Serialize an object:

byte[] payload =
    serializer.Serialize(product);

Deserialize an object:

Product? product =
    serializer.Deserialize<Product>(payload);

⚙️ Configuration

Customize serialization behavior during registration.

builder.Services.AddCoreSerialization(options =>
{
    // Configure JSON or MessagePack options here.
});

📚 Supported Serializers

JSON

Recommended for:

  • Human-readable payloads
  • Debugging
  • Maximum compatibility
var serializer =
    serializerFactory.GetSerializer(
        SerializerType.Json);

MessagePack

Recommended for:

  • High-performance APIs
  • Compact payloads
  • Low latency
var serializer =
    serializerFactory.GetSerializer(
        SerializerType.MessagePack);

Protocol Buffers

Recommended for:

  • Cross-platform communication
  • Contract-first serialization
  • Compact binary payloads
var serializer =
    serializerFactory.GetSerializer(
        SerializerType.Protobuf);

📦 Payload Format

CoreSystem.Serialization automatically determines how payloads are stored based on the selected serializer.

Serializer Payload Format
JSON Stored as plain UTF-8 JSON without additional metadata.
MessagePack Stored as binary data with a serializer identifier header.
Protocol Buffers Stored as binary data with a serializer identifier header.

The serializer identifier allows binary payloads to be deserialized automatically without requiring consumers to know which serializer was originally used.


⚠️ Exception Handling

All serializer-specific exceptions are wrapped in a common exception type.

try
{
    var payload = serializer.Serialize(product);
}
catch (CoreSerializationException ex)
{
    Console.WriteLine(ex.Serializer);
}

📊 Why CoreSystem.Serialization?

Capability Raw Serializer Libraries CoreSystem.Serialization


Unified API ❌ ✅ JSON ✅ ✅ MessagePack ✅ ✅ Protocol Buffers ✅ ✅ Dependency Injection ❌ ✅ Factory Pattern ❌ ✅ Common Exception Model ❌ ✅ Configurable Options Limited ✅


📚 Documentation

The complete documentation includes:

  • Getting Started
  • Configuration
  • JSON Serialization
  • MessagePack Serialization
  • Protocol Buffers Serialization
  • Dependency Injection
  • Exception Handling
  • Best Practices

Visit the GitHub repository for the complete documentation.


🤝 Contributing

Issues, discussions and pull requests are welcome.


📄 License

Released under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on CoreSystem.Serialization:

Package Downloads
CoreSystem.Cache

Distributed cache abstraction for .NET 8 supporting Redis and In-Memory providers, with native OpenTelemetry integration.

CoreSystem.Idempotency

Production-ready idempotency framework for ASP.NET Core that guarantees exactly-once request processing with Redis and PostgreSQL providers, request fingerprinting, response replay, and native OpenTelemetry support.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 133 7/10/2026
1.1.0 99 7/10/2026
1.0.0 94 7/8/2026

Initial stable release.
 • Unified serialization abstraction
 • JSON serializer
 • MessagePack serializer
 • Protocol Buffers serializer
 • Dependency Injection integration