serialization

Select and implement serialization formats for .NET data exchange.

Updated Feb 17, 2026
One-click install
npx skills add https://github.com/luongnguyenminhan/EmployeeDemoCS --skill serialization-luongnguyenminhan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: serialization
Source: https://github.com/luongnguyenminhan/EmployeeDemoCS/tree/main/.github/skills/serialization
Command: npx skills add https://github.com/luongnguyenminhan/EmployeeDemoCS --skill serialization-luongnguyenminhan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automatically select and implement the most suitable serialization strategy for .NET data contracts, reducing compatibility risks and manual guesswork.

Core Features & Use Cases

  • Guides selection between schema-based formats (Protobuf, MessagePack) and AOT-friendly System.Text.Json with source generators.
  • Provides setup guidance for APIs, messaging, and persistence pipelines across REST, gRPC, and event-sourcing scenarios.
  • Includes versioning and wire-compatibility recommendations to ensure forward and backward compatibility.

Quick Start

Choose a data contract and select Protobuf, MessagePack, or System.Text.Json with source generators to implement in your project.

Frequently Asked Questions about serialization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best .NET serialization format for gRPC and event sourcing?▼

For gRPC and event sourcing, schema-based .NET serialization formats like Protobuf and MessagePack are recommended. They provide strict data contract enforcement, high performance, and wire-compatibility for reliable messaging and persistence workloads.

How do I choose between Protobuf, MessagePack, and System.Text.Json for .NET APIs?▼

Choose .NET serialization formats based on workload needs: Protobuf for gRPC schema enforcement, MessagePack for compact messaging, and System.Text.Json with source generators for AOT-friendly REST APIs. The Skill guides this selection to reduce compatibility risks.

Does System.Text.Json with source generators work for AOT-compatible .NET serialization?▼

Yes, System.Text.Json with source generators enables AOT-compatible .NET serialization. It generates serialization code at compile time, avoiding runtime reflection and making it suitable for performance-sensitive REST API scenarios.

How do I handle versioning and backward compatibility with Protobuf in .NET?▼

To handle .NET serialization versioning with Protobuf, follow wire-compatibility recommendations ensuring forward and backward compatibility. This Skill provides guidance on managing data contract evolution to prevent breaking changes across distributed systems.

When should I not use schema-based serialization formats like Protobuf in .NET?▼

Avoid schema-based .NET serialization formats like Protobuf when working with REST APIs requiring human-readable payloads or when strict AOT compatibility is prioritized over compact binary messaging. System.Text.Json with source generators is better suited for these scenarios.