是否有替代MEF在.NET核心(或ASP.NET 5) [英] Is there a replacement for MEF in .NET Core (or ASP.NET 5)

查看:313
本文介绍了是否有替代MEF在.NET核心(或ASP.NET 5)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们知道,.NET核心(开源组件)的完整的.NET框架的一个子集,而ASP.NET 5(和MVC 6)是建立在.NET的核心。这是否意味着托管扩展性框架(MEF)不可用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?

如果是这样,有什么可替代的动态可扩展性.NET核心?

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

我有一些使用MEF动态加载插件和外部的集成应用,这将是一个遗憾,如果他们被锁在.NET Framework中仅仅是因为他们使用MEF。

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.

推荐答案

现有的NuGet包应该工作。它的便携和.NET核心是可移植的API表面的向后兼容的演变。 ASP.NET 5将当前未加载,但因为包没有明确说这是与ASP.NET Core 5的框架相兼容。便携式的NuGet包的细节仍在在新的.NET中芯国际制定。

The existing NuGet package should work. It's portable, and .NET Core is a backward-compatible evolution of the portable API surface. ASP.NET 5 won't currently load it, however because the package doesn't explicitly say that it's compatible with the ASP.NET Core 5 framework. The details of portable NuGet packages are still being worked out in the new .NET Core world.

您可能会迫使它通过下载和编辑程序包和重命名工作的便携式net45 + win8的+ WP8 + wpa81 forlder包括 + aspnetcore50

You could force it to work by downloading and editing the package and renaming the portable-net45+win8+wp8+wpa81 forlder to include +aspnetcore50.

这篇关于是否有替代MEF在.NET核心(或ASP.NET 5)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆