HighTechTalks DotNet Forums  

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

Dotnet FAQs microsoft.public.dotnet.faqs


Discuss how to locate & load 3rd party private assemblies at run time? in the Dotnet FAQs forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Terry McKiernan
 
Posts: n/a

Default how to locate & load 3rd party private assemblies at run time? - 07-07-2003 , 12:24 AM






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
terry (AT) pinpointtools (DOT) com
www.pinpointtools.com



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.