tags:

views:

106

answers:

1

I'm developing a class library that uses a very simple plugin structure - to simple to start creating new appdomains for each plugin. This is the folder structure:

Bin
    Modules
        Plugins.dll
    Main.dll
    Library.dll

During runtime I load the types in Plugins.dll using Reflection. I would like to pass one of my own objects that I have created in Library.dll to a class in Plugins.dll. But on the MethodInfo invoke line e.g.

pMi.Invoke({My Own Objects()})

it gives me a FileNotFound Exception as it cannot find Library.dll. What would be the best way of telling my library to look in the parent folder for the assembly?

Thanks for any help.

+1  A: 

When constructing you new app domains what are you setting as the ApplicationBase and the PrivateBinPath? Simply keeping the application base as "Bin" and putting Modules as the PrivateBinPath should be sufficient but not knowing how you are doing it I can't give you a definite answer.

As an aside is there any reason you aren't using the basic AddIn model present in MEF? (you can use System.AddIn without needing the full MEF bells and whistles)

ShuggyCoUk
+1 for System.AddIn and MEF
AJ