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

Possibility to control access flag of dynamic assembly #288

Open
azeno opened this issue Mar 5, 2018 · 1 comment
Open

Possibility to control access flag of dynamic assembly #288

azeno opened this issue Mar 5, 2018 · 1 comment
Labels

Comments

@azeno
Copy link

azeno commented Mar 5, 2018

Is there a way to control the AssemblyBuilderAccess flags which are used internally to create the dynamic assembly?
Having a case where I need to serialize a type which lives in a dynamic assembly created with AssemblyBuilderAccess.RunAndCollect which when trying to serialize will throw an exception that a non-collectible assembly may not reference a collectible assembly.

@yfakariya
Copy link
Member

Sorry for delay.

You can change with SerializationContext.SerializerOptions.GeneratorOption property. You can set this value to SerializationMethodGeneratorOption.CanCollect to result in AssemblyBuilderAccess.RunAndCollect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants