Best way to only perform a function if a (.NET) DLL is loaded?

I do not think many people would
actually use its functionality, so, I
would rather not include it by default
– just as an optional download.

Such things are typically described as plugins (or add-ons, or extensions).

Since .NET 4, the standard way to do that is with the Managed Exensibility Framework. It is included in the framework as the System.ComponentModel.Composition assembly and namespace. To get started, it is best to read the MSDN article and the MEF programming guide.

Leave a Comment