开发者

Assembly.Load or Assembly.ReflectionOnlyLoad

I am working on a smal开发者_运维知识库l method that will take a control that is bound to an object and return a value for an attribute assigned to that control's binding. I am able to use Assembly.Load just fine, and have seen Assembly.ReflectionOnlyLoad, but I could not get that to work for me. Is using Assembly.Load fine or should I not use that?


Assembly.ReflectionOnlyLoad() is good when you need to check assembly header properties such as version, public key etc. No actual code could be executed from the assembly and no dependencies are being linked in.

Mostly used in plugin-based systems with dynamic assembly updates - to check if there's an actual need to call Assembly.Load() since ReflectionOnlyLoad has way smaller footprint than full-scaled Load().


I would think Assembly.Load() would work fine, though you might find it easier to work with Assembly.LoadFrom().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜