0

I (like probably so many before me) tried to use the deprecated Assembly.Load(Byte[]) method to load an assembly into an application domain where said assembly data is transmitted over the network and therefore has technically no physical presence. I think I've been through just about every nook and cranny to try to get this to work, but I'm pretty convinced this is impossible (at least perhaps using my current methods).

I guess my question is, is it true that in order to load an assembly, it must be located in the CodeBase/GAC of the application? If so, why is that?

4

2 回答 2

1

不,这不是真的。您可以从字节数组加载程序集;该数组可以来自任何地方。例如,我之前使用过一个系统,该系统从程序集中加载插件,这些程序集作为二进制字段存储在数据库中。

(也许您应该问另一个问题并包括您遇到的问题,以便您可以正常工作:-))

于 2013-07-02T14:57:05.370 回答
1

当然不是。您只需要 .dll 文件的实际字节 [] 数据,在您调用 Load 方法后,它会在 CLR 中加载一切正常。

于 2013-07-02T14:58:12.923 回答