msgpack-cli
msgpack-cli copied to clipboard
Possibility to control access flag of dynamic assembly
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.
Sorry for delay.
You can change with SerializationContext.SerializerOptions.GeneratorOption property. You can set this value to SerializationMethodGeneratorOption.CanCollect to result in AssemblyBuilderAccess.RunAndCollect.