Selecting DLL's during program excecution

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?
 
B

Bob Grommes

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
 

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