Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>From <a href="http://blogs.msdn.com/suzcook" rel="noreferrer">Suzanne Cook's blog</a>:</p> <blockquote> <p><strong>LoadFile vs. LoadFrom</strong></p> <p>Be careful - these aren't the same thing.</p> <p>LoadFrom() goes through Fusion and can be redirected to another assembly at a different path but with that same identity if one is already loaded in the LoadFrom context.</p> <p>LoadFile() doesn't bind through Fusion at all - the loader just goes ahead and loads exactly* what the caller requested. It doesn't use either the Load or the LoadFrom context.</p> <p>So, LoadFrom() usually gives you what you asked for, but not necessarily. LoadFile() is for those who really, really want exactly what is requested. (*However, starting in v2, policy will be applied to both LoadFrom() and LoadFile(), so LoadFile() won't necessarily be exactly what was requested. Also, starting in v2, if an assembly with its identity is in the GAC, the GAC copy will be used instead. Use ReflectionOnlyLoadFrom() to load exactly what you want - but, note that assemblies loaded that way can't be executed.)</p> <p>LoadFile() has a catch. Since it doesn't use a binding context, its dependencies aren't automatically found in its directory. If they aren't available in the Load context, you would have to subscribe to the AssemblyResolve event in order to bind to them.</p> </blockquote> <p>See <a href="http://blogs.msdn.com/suzcook/archive/2003/09/19/loadfile-vs-loadfrom.aspx" rel="noreferrer">here</a>.</p> <p>Also see <a href="http://blogs.msdn.com/suzcook/archive/2003/05/29/57143.aspx" rel="noreferrer">Choosing a Binding Context</a> article on the same blog.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload