Andy Hin
Andy Hin

Reputation: 31863

C# plugin system design

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...

Upvotes: 1

Views: 1195

Answers (3)

Pedro
Pedro

Reputation: 388

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.

Upvotes: 0

Steve Whitfield
Steve Whitfield

Reputation: 2029

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.

Upvotes: 0

spender
spender

Reputation: 120380

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.

Upvotes: 9

Related Questions