how to locate & load 3rd party private assemblies at run time?
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
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!
|All times are GMT. The time now is 04:54 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.