Allows client code to avoid tripping over StandardResolver#1315
Merged
AArnott merged 1 commit intoMessagePack-CSharp:developfrom Sep 2, 2021
Merged
Allows client code to avoid tripping over StandardResolver#1315AArnott merged 1 commit intoMessagePack-CSharp:developfrom
AArnott merged 1 commit intoMessagePack-CSharp:developfrom
Conversation
In AOT-only environments it seems it was impossible to avoid loading `StandardResolver` because the `MessagePackSerializer` had a static property with an initializer that loaded the `StandardResolver`. After this change, if the `DefaultOptions` getter is never called, or its setter is called first, then the `StandardResolver` can be avoided. Fixes MessagePack-CSharp#832
neuecc
approved these changes
Aug 23, 2021
Member
neuecc
left a comment
There was a problem hiding this comment.
Thank you!
I often work on issues related to AOT and loading, but I think more carefully about these patterns.
This was referenced Oct 26, 2025
This was referenced Dec 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In AOT-only environments it seems it was impossible to avoid loading
StandardResolverbecause theMessagePackSerializerhad a static property with an initializer that loaded theStandardResolver.After this change, if the
DefaultOptionsgetter is never called, or its setter is called first, then theStandardResolvercan be avoided.Fixes #832