Skip to content

creating DynamicAssembly to lazy - #996

Merged
neuecc merged 2 commits into
masterfrom
fix-for-xamarin
Aug 8, 2020
Merged

neuecc merged 2 commits into
masterfrom
fix-for-xamarin

Conversation

@neuecc

@neuecc neuecc commented Aug 5, 2020

Copy link
Copy Markdown
Member

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
@neuecc
neuecc merged commit 2bbf2e1 into master Aug 8, 2020
@neuecc
neuecc deleted the fix-for-xamarin branch August 8, 2020 21:53
@AArnott AArnott added this to the v2.1 milestone Aug 12, 2020
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.

2 participants