Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are 3 kinds of Binding Contexts for?

Tags:

c#

.net

There are probably only a few people who can answer the "why" part of the question. The load contexts mostly have to do with how dependencies are bound. My understanding is that:

  • Load, loads an assembly into the AppDomain using "traditional" location and binding methods. The loaded assembly can be used as a dependency for subsequent assemblies loaded in the Load context.
  • LoadFrom, loads an assembly into the AppDomain finding dependencies like Load but with one difference: these assemblies will not be used to resolve the dependencies of Load context assemblies.
  • LoadNeither loads just that one assembly. If it has unresolved dependencies, you will need to resolve them yourself via the AssemblyResolve event.

This is a great blog about it: http://blogs.msdn.com/suzcook/archive/2003/05/29/57143.aspx