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

Discussion in 'ASP .Net' started by Terry McKiernan, Jul 7, 2003.

  1. 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 McKiernan
    pinpoint tools
    Terry McKiernan, Jul 7, 2003
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BestNews

    Any 3rd party Grid control in dotnet

    BestNews, Aug 26, 2003, in forum: ASP .Net
    Robert Jacobson
    Aug 26, 2003
  2. Matalote
    Jan 26, 2004
  3. Manoj Paramu Das
    Nick Harris
    May 6, 2004
  4. Alvin Bruney

    Re: Locate assemblies in ASP.NET

    Alvin Bruney, Jul 18, 2003, in forum: ASP .Net
    Alvin Bruney
    Jul 18, 2003
  5. =?Utf-8?B?Sm9obi5ORVQ=?=

    Run 3rd party app as specified user

    =?Utf-8?B?Sm9obi5ORVQ=?=, Jul 11, 2006, in forum: ASP .Net
    Jul 11, 2006

Share This Page