Selecting DLL's during program excecution

  • Thread starter Thread starter albert duffus
  • Start date Start date
A

albert duffus

Selecting DLL's during program excecution

Let's suppose I have 2 dll's. One is my.dll, the other
is my2.dll.

During program excecution, when those dll's are called
for use, how can I select my2.dll first, and if that is
not found, select my.dll?

Do yo have a short snippet of code to demonstrate?
 
You would use File.Exists or FileInfo.Exists to determine if the DLL is
there. To load one or the other based on such a runtime decision is done
using the System.Reflection classes.

It might be a good idea to go into a little detail as to what you're trying
to accomplish. There may be simpler, and possibly better, ways to acheive
your goals than resorting to reflection and late binding calls. Which is
not to say that reflection is a Bad Thing ... it's just a lot of extra work
if you don't really need it.

--Bob
 
Back
Top