serialization

Select optimal .NET serialization formats for APIs, messaging, and storage.

Updated Feb 10, 2026
One-click install
npx skills add https://github.com/tientt010/Dotnet-JiraLite-Microservices --skill serialization-tientt010
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: serialization
Source: https://github.com/tientt010/Dotnet-JiraLite-Microservices/tree/main/.github/skills/serialization
Command: npx skills add https://github.com/tientt010/Dotnet-JiraLite-Microservices --skill serialization-tientt010

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Choosing the right serialization approach for .NET applications to balance performance, versioning, and long-term maintainability across APIs, messaging, and storage.

Core Features & Use Cases

  • Schema-based vs reflection-based: Compare Protobuf, MessagePack, and System.Text.Json with source generation to minimize runtime reflection and enable explicit schemas.
  • Versioning & compatibility: Guidance on safe field additions/removals, notes on back-compat and forward-compat across wire formats.
  • Migration patterns: How to migrate from Newtonsoft.Json to modern JSON with AOT-friendly options and minimal risk.
  • Use Case: Build a microservice that uses gRPC for API calls and event logs JSON; pick formats per boundary to maximize performance and safety.

Quick Start

Analyze a project to determine the best serialization approach to meet performance, compatibility, and maintenance goals.

Frequently Asked Questions about serialization

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

FAQPage Schema
How do I migrate from Newtonsoft.Json to System.Text.Json for AOT compatibility?

Migrating from Newtonsoft.Json to modern System.Text.Json involves applying source generation for AOT-friendly JSON, reducing runtime reflection, and following specific migration patterns to minimize risk.

Does System.Text.Json source generation work with AOT scenarios in .NET?

Protobuf and MessagePack provide schema-based binary wire formats, while System.Text.Json source generation enables explicit schemas and AOT-friendly JSON, minimizing runtime reflection for performance and safety.

What's the best way to configure serialization for a .NET microservice using gRPC?

Handling versioning with Protobuf and MessagePack requires guidance on safe field additions and removals, ensuring both backward compatibility and forward compatibility across diverse wire formats.

Can I use Protobuf for both API calls and event logs in a .NET microservice?

You should avoid reflection-based serialization in .NET when targeting AOT scenarios or needing maximum performance, instead using schema-based formats or source generation to minimize runtime reflection.