Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to create a plugin environment in .NET

I read this aricle How to load plugins in .NET?, and I really don't see the brilliance of Microsoft's System.Addin namespace. Why can't I just have a plugins folder in my bin directory that users can put an assembly into that implements an interface I design? I could then just use reflection to create an instance of the plugin class and reference it with my interface.

Why is the System.Addin way apparently so much better? Especially since it seems like three times the work and a less intuitive design.

like image 924
Jonathan Henson Avatar asked Jun 08 '11 19:06

Jonathan Henson


People also ask

What is .NET plugin?

NET Plugins. This project provides API for loading . NET assemblies dynamically, executing them as extensions to the main application, and finding and isolating the dependencies of the plugin from the main application. It allows fine-grained control over assembly isolation and type sharing.

How do I create a Dynamics CRM plugin?

Registering a Plugin in Dynamics 365Download the Plugin registration tool using NuGet or PowerShell, then open it by clicking PluginRegistration.exe. Connect to your instance by selecting Create new Connection. Make sure you have office 365 selected. Enter your Microsoft Account credentials, then click Login.

What is a plugin C#?

In today's article, we will take a look at using the plugin pattern in C#. The plugin pattern allows us to drop assemblies into a particular location and use their implementation in our applications. This is one way we can create loosely coupled applications.


1 Answers

I would recommend looking at the Managed Extensibility Framework (which was added to the core framework in .NET 4). It allows you to do exactly what you're describing, and is very simple and flexible to use in extensibility scenarios.

like image 120
Reed Copsey Avatar answered Sep 25 '22 13:09

Reed Copsey