Use Load or LoadFrom to load an assembly

K

Karen

Hi,
Which method is recommended (load or loadfrom) for loading
assemblies, both in terms of performance and versioning of assmeblies?


Thanks
Karen
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

It depends of the use you want, in LoadFrom you set the location of the
file , this should be faster than Load() which has to look in several
locations , also in the latter you search by assembly name where in LoadFrom
you look by filename.

I would recommend to use Load(0 if that suits you.

Regarding speed LoadFrom() may be faster, it does not have to search on
several locations.


Cheers,
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi ,

No I did not , in fact I have never had the need to load an assembly, it
was just a kind of "logic" assumption, LoadFrom may has to look in several
places , whether LoadFrom knows exactly where the assembly is located, so I
thought it should be faster.

As you pointed out I was wrong :)

My fault for giving an opinion lightly :)

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top