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.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
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"
}
}
}
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0