Assembly.LoadFile question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

Would anyone know Assembly.LoadFile(file) method prevents loading the same
assembly multiple times even if it's called over and over again with the same
file? If it does not, what's the better way to make sure only one copy of the
same assembly is loaded (the first time called)?

Thanks.
 
There are some subtle differences between LoadFrom and LoadFile. This blog
talks about a lot of these issues.

http://weblogs.asp.net/suzcook

LoadFrom can be redirected, LoadFile will always load exactly that file. I
think both forms will usually load the same assembly once (LoadByte will
load it over and over again). However, LoadFile does not have a fusion
context so any dependencies it has will not be automatically resolved.

Without knowing more about what you really want to accomplish it's not
possible to determine which method is most suitable.
 
Back
Top