msgpack-cli icon indicating copy to clipboard operation
msgpack-cli copied to clipboard

Possibility to control access flag of dynamic assembly

Open azeno opened this issue 6 years ago • 1 comments

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.

azeno avatar Mar 05 '18 17:03 azeno

Sorry for delay.

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

yfakariya avatar Mar 26 '18 14:03 yfakariya