Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

creating DynamicAssembly to lazy #996

Merged
merged 2 commits into from
Aug 8, 2020
Merged

creating DynamicAssembly to lazy #996

merged 2 commits into from
Aug 8, 2020

Conversation

neuecc
Copy link
Member

@neuecc neuecc commented Aug 5, 2020

creating DynamicAssembly in cctor causes AOT Exception in AOT Environment(Unity IL2CPP, Xamarin iOS, etc).
For example, StandardResolver contains some dynamic assemblies but GeneratedResolver override before used it.

CompositeResolver.Create(
     MessagePack.Resolvers.GeneratedResolver.Instance,
     MessagePack.Resolvers.StandardResolver.Instance);

It should work fine but if DynamicAssembly creating in cctor, throws exception.

This PR delayed to create DynamicAssembly until type requested.

This code is disscussed at #703,
maybe will solve #977, #973
and related to #890

@neuecc neuecc requested a review from AArnott August 5, 2020 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants