Live Chat Programs

March 25, 2008

Load(AssemblyName)

Filed under: Live Chat software

Also see: Startup, Shutdown and related matters

Also see: ReflectionTypeLoadException

Also see: Turning bitboards from potential moves into legal moves, pawn moves, and conditional rules.

Also see: Hosting

Calling Load(AssemblyName) is not necessarily the same as calling Load(String). If the AssemblyName.CodeBase is not set, then they do do the same thing. So, if you’ve set the AssemblyName.Name, CultureInfo, public key token / public key and/or Version properties, it would be the same as if you had specified those properties in a String (as a display name ) and passed that to Load(String).

If the CodeBase is set, but the Name is not, however, then it’s the same as calling Assembly.LoadFrom() on that CodeBase.

When both the CodeBase and the Name are set, then the bind is tried with all the given binding information except the CodeBase (so, again, just like calling Load(String)). If that succeeds, we’re done. But, if that fails, then the bind is tried again with just the CodeBase (just like LoadFrom()). If it fails again, then, of course, the whole bind fails. But, if it succeeds, then we verify that the binding properties in the AssemblyName match the found assembly. If they don’t match, a FileLoadException will be thrown for hresult FUSION_E_REF_DEF_MISMATCH.

So, setting both the CodeBase and the Name is useful for when you want to both load an assembly at a given path into the LoadFrom context, and verify that it has the public key token, etc. that you expect. Of course, as described above (and due to binding context rules ), keep in mind that just because you call Load(AssemblyName) with a CodeBase, it does not mean th

Live Help Software: Live Chat with Users on your websites. It is FREE !
at it will be loaded from that path.


http://blogs.msdn.com/suzcook/archive/2004/08/04/load-assemblyname.aspx

Comments »

The URI to TrackBack this entry is: http://thelivechatsoftware.blogsome.com/2008/03/25/loadassemblyname-2/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome
Theme designed by Jay of onefinejay.com