tags:

views:

52

answers:

3

So I am creating a plugin system for my app.

I have the following components: 1) Main Application 2) PluginInterface.dll 3) Plugin(s).dll

The problem now is that, when I create my plugins and compile them, there are more then just the Plugin.dll file. It has other required files in the Release directory such as the PluginInterface.dll that it uses, an xml configuration file, etc.

So how can I make it so that it is just a single dll file that user can drop into a plugin directory?

OR

do you think it's better to have the plugins be a folder? then, i have to scan all the folders for the right DLL...

+6  A: 

The Managed Extensibility Framework is designed for plugin architectures. Before you go too far down your current path, check it out. It might serve you better.

spender
I implemented a custom plug-in framework as part of a project about four years ago. I can say that I wish MEF had been available then. It would have saved a lot of work. I would recommend MEF.
Jim Reineri
A: 

When you compile your plug-in project, right-click on the references to the DLLs you are seeing and select properties. In the proepties set the "Copy Local" property to "false". Make sure that these DLLs are part of your main application, otherwise the code will fail when it can't find code that depends on it.

Steve_
A: 

If you want to do that when compiling your solution you should create a post build event (Project Properties -> Build Events) to copy only the required files to the plugin directory. You could also change the OutputPath of you project and use the option "Copy Local" to "false", but you'll not have the same level of control as by creating a build event.

Pedro