Mandeep Singh
Mandeep Singh

Reputation: 103

C# .NET Plugin Framework

I have been working on a Plugin based application in C#. Stumbled across Managed Extensibility Framework (MEF) but this seems to be obsolete and support is dropped off Prism and other Frameworks.

Are there any alternatives to MEF for .NET Framework? A lot of information around plugins is rather dated and old.

Thanks

Upvotes: 1

Views: 2285

Answers (2)

Haukinger
Haukinger

Reputation: 10863

Are there any alternatives to MEF for .NET Framework?

MEF is perfectly fine as plugin framework, no need to look somewhere else.

But you shouldn't also use it as dependency injection container (see Dan's answer).

Upvotes: 1

Dan Siegel
Dan Siegel

Reputation: 5799

MEF is NOT a Dependency Injection Container and for that reason it has been removed. So where to look?

  • The Unity Container (not to be confused with the Unity game development framework), has long been a very popular container for Prism developers, and is what Brian has used for years.
  • DryIoc has been a very popular and extremely fast alternative for the last several years and has converted many long term Unity fans because of it's performance and great API's.
  • Ninject is still supported for the moment for WPF. That said this could change in the future. The project is showing signs of being dead. They haven't had a release in over 2 years, it's not particularly fast, or widely used by Prism Developers.
  • BYOC (Bring your own container)... Prism 7 introduced a complete abstraction for Dependency Injection. This means that if there is a container that you would like to use, you can implement the IContainerExtension for the container you want and bring that into your project. NOTE for WPF development you would still need to tie that container into the ServiceLocator currently used by WPF. You can read more on that from this blog post on Using "Unsupported" DI Containers

Upvotes: 1

Related Questions