doc/migrating_v2-v3.md
The most significant change in v3 is that AOT source generation of formatters is on by default. These new formatters are comparable to the dynamic formatters generated at runtime in prior versions, but they have some limitations not shared by their dynamically generated counterparts. These limitation and other migration requirements and considerations are enumerated below or are called out by analyzers.
The MessagePackAnalyzer nuget package, which was optional in v2, is now a nuget dependency, which means diagnostics may appear in your compilation after upgrading to v3 that you have not seen before.
v3 adds many new diagnostic providers to the set of analyzers as well, with general help and specific help for handling the new source generated formatters.
MessagePackAnalyzer.json is no longer used to configure the analyzer.
Use GeneratedMessagePackResolverAttribute, MessagePackKnownFormatterAttribute and MessagePackAssumedFormattableAttribute instead.mpc CLI tool is no longer used to generate ahead-of-time (AOT) formatters and resolver.
AOT code generation is "on by default" in v3 courtesy of our roslyn source generator.IMessagePackFormatter<T> should be internal for automatic inclusion in our source generated resolver.[MessagePackObject] should be declared as partial to grant the source generated formatter access to private/protected members, when applicable.MessagePack nuget package instead of acquiring source code via the .zip file on our Releases page.MessagePackAnalyzer.json file[assembly: MessagePackAssumedFormattable(typeof(MyType1))] to your project for each type that appears inside your MessagePackAnalyzer.json file.MessagePackAnalyzer.json file.mpcmpc from your build.Be sure to build with .NET SDK 6.0 or later.