I notice that there is a method of System.Reflection.Assembly
, which is Assembly Load(byte[] rawAssembly)
.
I wonder if there is an opposite ope
System.Reflection.Assembly implements ISerializable. Create an instance of BinaryFormatter and call its Serialize method on any stream - MemoryStream, FileStream, etc.
Assembly yourAssembly;
var formatter = new BinaryFormatter();
var ms = new MemoryStream();
formatter.Serialize(ms, yourAssembly);
var reloadedAssembly = Assembly.Load(ms.GetBuffer());