
17

.NET core下的MEF
source link: https://www.cnblogs.com/TianFang/p/14091872.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Managed Extensibility Framework(MEF)通常用来开发可扩展的UI程序,在.net的历史上,出现过两个版本的MEF,我们一般把它称为MEF v1和MEF v2。
MEF V1
MEF V1最初是.net framework 4.0中引入的,出现的比较早,功能比较强大,网上对它的介绍不少。 我开发复杂点的UI程序经常使用到它,之前在文章.Net中的插件框架中介绍过它。
MEF V2
MEF V2最初是作名为Microsoft.Composition的Nuget包在WinRT平台中引入的。我之前写过文章在WinRT程序中使用MEF介绍过它的简单用法。相比MEF V1,功能少了不少,基本上是个半残,由于我WinRT程序本来就写的少,对它用的也较少。
.NET core下的MEF
在.net core平台下,MEF是作为Nuget包的形式提供的:
- V1 版本: System.ComponentModel.Composition
- V2 版本: System.Composition
其中,功能更强大的V1版本是 Windows Compat Pack 的一部分,目前是不支持跨平台的。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK