What are 3 kinds of Binding Contexts for?

后端 未结 1 384
梦毁少年i
梦毁少年i 2020-12-30 22:09

I know that there are 3 different binding contexts or load contexts:

Load
LoadFrom
LoadNeither
  1. What are load contexts?
  2. What
相关标签:
1条回答
  • 2020-12-30 22:26

    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

    0 讨论(0)
提交回复
热议问题