Skip to content

[WebPubSub] Upgrade MessagePack from 2.5.192 to 3.x #54868

@jsquire

Description

@jsquire

Upgrade MessagePack from 2.5.192 to 3.x

Summary

The MessagePack package is currently pinned at version 2.5.192 in eng/Packages.Data.props. Version 3.x is now available with significant improvements but includes breaking changes that require a dedicated migration effort.

Current State

  • Current Version: 2.5.192
  • Latest Version: 3.1.4
  • Location: eng/Packages.Data.props line ~280

Why Upgrade?

MessagePack 3.x introduces:

  • AOT source generation by default using Roslyn source generators (improved startup performance, better debugging)
  • Support for serializing private members without DynamicObjectResolverAllowPrivate
  • Analyzers enabled by default with new diagnostics
  • Custom formatters automatically discovered in same assembly
  • New [CompositeResolver] attribute for faster runtime alternative
  • .NET 9 support with Int128, UInt128, Rune, OrderedDictionary<T,V>, ReadOnlySet<T>

Breaking Changes

Major Changes

  1. mpc tool is no longer available - replaced by Roslyn source generators
  2. AOT source generation is the default - dynamic formatters still exist but are secondary
  3. Custom formatters auto-discovery - formatters in same assembly are automatically used unless attributed with [ExcludeFormatterFromSourceGeneratedResolver]
  4. Unity distribution changed - now via NuGetForUnity and UPM instead of .unitypackage

Migration Required

  • Review all [MessagePackObject] types for compatibility
  • Update any code that relied on mpc generation
  • Test serialization behavior with new source generator
  • Review analyzer warnings (now on by default)

Migration Guide

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue is related to a non-management packageService AttentionWorkflow: This issue is responsible by Azure service team.WebPubSub

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions