Zteck
Zteck

Reputation: 527

Assembly.Load or Assembly.ReflectionOnlyLoad

I am working on a small 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?

Upvotes: 0

Views: 1036

Answers (2)

Vitaly
Vitaly

Reputation: 823

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().

Upvotes: 3

IronicMuffin
IronicMuffin

Reputation: 4192

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

Upvotes: 0

Related Questions