This covers JSON, Protocol Buffers, and MessagePack for .NET, with a strong focus on AOT compatibility and moving away from Newtonsoft.Json. The comparison tables are genuinely helpful for deciding between formats: use System.Text.Json with source generators for APIs and web clients, Protobuf for gRPC and service-to-service communication where schema evolution matters, and MessagePack when you need compact binary without managing .proto files. The guidance on avoiding BinaryFormatter and reflection-based serializers is spot on. The examples show real patterns like combining multiple JsonSerializerContext instances and handling polymorphic types with JsonDerivedType. If you're still using Newtonsoft.Json or wondering which binary format fits your use case, this gives you concrete decision criteria and working code.

skills.sh installs
530
GitHub stars
90
last updated
Aug 21, 2026

Install

$ npx -y skills add wshaddix/dotnet-skills --skill serialization --agent claude-code

Installs into .claude/skills of the current project.

Files

Serialization in .NET

When to Use This Skill

Use this skill when:

  • Choosing a serialization format for APIs, messaging, or persistence
  • Migrating from Newtonsoft.Json to System.Text.Json
  • Implementing AOT-compatible serialization
  • Designing wire formats for distributed systems
  • Optimizing serialization performance

Serialization Format Comparison

FormatLibraryAOT-SafeHuman-ReadableRelative SizeRelative SpeedBest For
JSONSystem.Text.Json (source gen)YesYesLargestGoodAPIs, config, web clients
ProtobufGoogle.ProtobufYesNoSmallestFastestService-to-service, gRPC wire format
MessagePackMessagePack-CSharpYes (with AOT resolver)NoSmallFastHigh-throughput caching, real-time
JSONNewtonsoft.JsonNo (reflection)YesLargestSlowerLegacy only -- do not use for AOT

When to Choose What

Sponsors

Details

Repository
github.com/wshaddix/dotnet-skills
Categories
Debugging, .NET & C#
First seen
Jun 3, 2026

More from wshaddix/dotnet-skills

All 13

Recommended

More Debugging
1aj-geddes avatarkpi-dashboard-designaj-geddes/useful-ai-promptsDesign and build dashboards that track key performance indicators. Select relevant metrics, visualize data effectively, and communicate insights to stakeholders528skills.sh installs
2jwynia avatargood-thinkingjwynia/agent-skillsDiagnose thinking failures and maintain process-sovereignty by auditing cognitive orientation and operation balance.528skills.sh installs
3aj-geddes avatarsql-query-optimizationaj-geddes/useful-ai-promptsAnalyze and optimize SQL queries for performance. Use when improving slow queries, reducing execution time, or analyzing query performance in PostgreSQL and MyS527skills.sh installs
4jwynia avatarlyric-diagnosticjwynia/agent-skillsDiagnose lyric problems across prosody, rhyme, meaning, register, sound, and structure. Use when AI-generated or human lyrics feel flat, cliched, awkward, or mi526skills.sh installs
5dstn2000 avatarunreal-enginedstn2000/claude-unreal-engine-skillComprehensive Unreal Engine C++ and Blueprint development assistant with deep project structure understanding. Use when helping with Unreal Engine projects, inc522skills.sh installs
6connorads avatarweb-animation-designconnorads/dotfilesDesign and implement web animations that feel natural and purposeful. Use this skill proactively whenever the user asks questions about animations, motion, easi521skills.sh installs