how to locate & load 3rd party private assemblies at run time?

  • Thread starter Terry McKiernan
  • Start date
T

Terry McKiernan

I'm writing an add-on to a 3rd party commercial application. This other app
has a bunch of private assemblies -- nothing in the GAC, all private -- and
to interact with the app I need to use various objects in these assemblies.
That's how this other app's SDK works.

The problem is, I don't know in advance where the other app is installed.
It has a regular setup wizard so the end user can choose an installation
directory. My add-on application is to be distributed via the web, not
installed and configured by hand. So I can't assume any particular location
for the 3rd party app's DLLs, and I am not going to be around to tweak the
..config file for my add-on app by hand each time. It needs to handle things
dynamically. Else, I get the dreaded System.IO.FileNotFoundException.

I can look in the registry and get the installation path for the 3rd party
app, and thus find its DLLs. But what do I do next? I've tried loading
these assemblies using Assembly.LoadFrom(), but I'm not sure what to do
afterwards -- how do I then create objects, call methods etc? I also read
some advice saying I should create a new AppDomainSetup and set the
ApplicationBase path to be the path to the 3rd party app, but I'm still not
clear what to do after that and then I won't be able to load my own app's
private assemblies.

Seems like this is a common enough problem and there should be an easy
solution, but I can't find it. Can anyone tell me the trick? How do you
locate, load and USE private assemblies where you do not know their location
in advance but can discover them at run time? Thanks!

--

Terry

Terry McKiernan
pinpoint tools
(e-mail address removed)
www.pinpointtools.com
 

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

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,141
Latest member
BlissKeto
Top