Skip to main content
net10.0net8.0.NETStandard2.1

Fast, flexible, and version-tolerant serializer for .NET

Published
Aug 25, 2026
1mo ago
Total Downloads
13.7M
13,719,384

Install

dotnet add package Microsoft.Orleans.Serialization --version 10.3.0-rc.1
ProductVersions
.NET
net10.0net8.0
.NET Standard
netstandard2.1

README

Microsoft Orleans Serialization

Introduction

Microsoft Orleans Serialization is a fast, flexible, and version-tolerant serializer for .NET. It provides the core serialization capabilities for Orleans, enabling efficient serialization and deserialization of data across the network and for storage.

Getting Started

To use this package, install it via NuGet:

dotnet add package Microsoft.Orleans.Serialization

This package is automatically included when you reference the Orleans SDK or the Orleans client/server metapackages.

Example

// Creating a serializer
var services = new ServiceCollection();
services.AddSerializer();
var serviceProvider = services.BuildServiceProvider();
var serializer = serviceProvider.GetRequiredService<Serializer>();

// Serializing an object
var bytes = serializer.SerializeToArray(myObject);

// Deserializing an object
var deserializedObject = serializer.Deserialize<MyType>(bytes);

Supporting your own Types

To make your types serializable in Orleans, mark them with the [GenerateSerializer] attribute and mark each field/property which should be serialized with the [Id(int)] attribute:

[GenerateSerializer]
public class MyClass
{
    [Id(0)]
    public string Name { get; set; }
    
    [Id(1)]
    public int Value { get; set; }
}

When fail-closed type validation is enabled, additional types can be allowed by configuring TypeManifestOptions.AddAllowedType or TypeManifestOptions.AddAllowedAssembly.

Documentation

For more comprehensive documentation, please refer to:

Feedback & Contributing

Changes from Previous Version

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.The published metadata declares 32 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.