Hi friends
What is the difference between using Load,LoadFrom and LoadFile methods of the Assembly class.Also wanted an example of use of reflection for Late Binding
Thanks
Reflection
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Jaish MathewsRank #225 · 11K reputationPosted May 5, 2010, 11:52 PM EDT
You should never use Assembly.LoadFile(). Use LoadFrom() if you know where the assembly is located, use Load() to let .NET figure out where the assembly is located. Using Load() should be your preference but may require a .config file to help .NET find the assembly like below
Differentiate LoadFrom and LoadFile
Use the LoadFile method to load and examine assemblies that have the same identity, but are located in different paths. LoadFile does not load files into the LoadFrom context, and does not resolve dependencies using the load path, as the LoadFrom method does. LoadFile is useful in this limited scenario because LoadFrom cannot be used to load assemblies that have the same identities but different paths; it will load only the first such assembly.
Vipul KelkarRank #1,061 · 1.8K reputationPosted May 6, 2010, 12:22 AM EDT
CrishRank #1,486 · 1.1K reputationPosted May 6, 2010, 12:53 AM EDT
http://www.proprofs.com/forums/index.php?showtopic=13287
http://msdn.microsoft.com/en-us/library/b61s44e8.aspx
will helpful for you.