我想通过将程序集保存到光盘或在运行时反射(reflect)它来获得程序集。程序集由第三方在内存中动态生成。
有人知道怎么做吗?
最佳答案
试试这个(找到 here ):
byte[] dllAsArray;
using (MemoryStream stream = new MemoryStream())
{
BinaryFormatter formatter = new BinaryFormatter();
formatter.Serialize(stream, results.CompiledAssembly);
dllAsArray = stream.ToArray();
}
关于c# - 如何保存存储在内存中的动态生成的程序集?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1872502/