Welcome to jBasket Interviews, where you can ask questions and receive answers from other members about job interviews and job seeking tips.

When would using Assembly.LoadFrom or Assembly.LoadFile be appropriate?

0 votes
Explain Assembly.LoadFrom and LoadFile and their usages.
asked 2 years ago by scott (560 points)

1 Answer

0 votes
Assembly.LoadFrom : avoid loading assembly with the same name if there is already one loaded.

Assembly.LoadFile: load exactly the specify assembly.

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.
answered 2 years ago by gooseman (290 points)

Related questions