Difference between Assembly.LoadFrom() and Assembly.LoadFile() methods?

 Posted by Ddd on 3/16/2011 | Category: .NET Framework Interview questions | Views: 9784 | Points: 40

Both methods are used to load the assemblies. we can then extract all the metatdata of the assembly using Reflection.


1)LoadFrom can use either the name or the path of the assembly,
LoadFile will expect the path of the assembly(see the overloaded versions)

2)LoadFrom uses a probing algorithm to find the assembly.f if you have two assemblies that have the same identity but different locations, you can get some unexpected behavior.But using LoadFile, you can load the desired assembly as needed.

Source: http://www.codeproject.com | Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response