How to load plugins in .NET?

Michał Piaskowski picture Michał Piaskowski · Aug 18, 2008 · Viewed 13.9k times · Source

I'd like to provide some way of creating dynamically loadable plugins in my software. Typical way to do this is using the LoadLibrary WinAPI function to load a dll and calling GetProcAddress to get an pointer to a function inside that dll.

My question is how do I dynamically load a plugin in C#/.Net application?

Answer

Matt Hamilton picture Matt Hamilton · Aug 18, 2008

As of .NET 3.5 there's a formalized, baked-in way to create and load plugins from a .NET application. It's all in the System.AddIn namespace. For more information you can check out this article on MSDN: Add-ins and Extensibility