Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a replacement for MEF in .NET Core (or ASP.NET 5)

We know that .NET Core (the open-source components) are only a subset of the full .NET Framework, and that ASP.NET 5 (and MVC 6) is built on .NET Core. Does this mean that Managed Extensibility Framework (MEF) is not available in ASP.NET 5?

If so, is there any replacement for dynamic extensibility available in .NET Core?

I have a number of applications that use MEF to dynamically load plugins and external integrations and it would be a pity if they were locked into the .NET Framework just because they use MEF.

like image 697
agc93 Avatar asked Mar 02 '15 01:03

agc93


People also ask

Is MEF available in .NET Core?

For those who don't know, the Managed Extensibility Framework (MEF) is alive and well, and has been ported to . NET Core as System.

Does .NET 5.0 replace .NET Core?

Net 5 that is Opensource and Cross-platform, which will replace . Net Framework, . Net Core and Xamarin with a single unified platform called . Net 5 Framework.

Is .NET 5 the same as .NET Core 5?

ASP.NET Core 5.0 is based on . NET 5 but retains the name "Core" to avoid confusing it with ASP.NET MVC 5. Likewise, Entity Framework Core 5.0 retains the name "Core" to avoid confusing it with Entity Framework 5 and 6.

What is replacing .NET Core?

NET 5 is an open-source, cross-platform . NET framework, that will replace . Net Framework, . Net Core, and Xamarin with a single unified platform. . NET 5 is a single platform that you can use for all your modern .


1 Answers

The existing NuGet package should work. It's portable, and .NET Core is a backward-compatible evolution of the portable API surface. ASP.NET Core won't automatically install it, however because the package doesn't explicitly say that it's compatible with .NET Core.

To install the package, you'll need to add an imports section to your project.json:

{
  "dependencies": {
    "Microsoft.Composition": "1.0.30"
  },
  "frameworks": {
    "netcoreapp1.0": {
      "imports": "portable-net45+win8"
    }
  }
}
like image 188
bricelam Avatar answered Sep 20 '22 08:09

bricelam