What's the right way to use managed Extensibility Framework in Net Core
Asked Answered
O

0

6

I've been working in an app that'll be fully extensive as it should implements a plugins system (quite a few contracts in the same app) My preoccupation is about using MEF (Managed Extensibility Framework) I've find out a lot of tutorials, but somes seems to be outdated, and some are more confusing In general

Whe have a way to do it by using these namespaces

  • System.ComponentModel.Composition

  • System.Composition

  • Microsoft.Composition

And the latest methods I found in a Microsoft tutorial, that use an AssemblyLoadContext and an Activator Here is the link

https://learn.microsoft.com/en-us/dotnet/core/tutorials/creating-app-with-plugin-support

I really like this last method because it's simple and I have a good working implementation already !

I'm just asking myself: is it the right way to do it in an app that'll be widely distributed ? It sit secured enough ?

Offset answered 9/12, 2021 at 7:22 Comment(3)
IMHO the right way is to ditch MEF in .NET Core and use the generic host but I don't know what features it doesn't have which MEF would have had, if any. learn.microsoft.com/en-us/dotnet/core/extensions/generic-hostFreshman
Thank you for your reply, I'll ditch into The Use generic-hostOffset
You can also use a custom AssemblyLoadContext with plugins: learn.microsoft.com/en-us/dotnet/core/tutorials/…Darrelldarrelle

© 2022 - 2024 — McMap. All rights reserved.