如何 install/get 从 MEF 2 开始

How to install/get started with MEF 2

我想在项目中使用 MEF 2。我正在尝试 follow this guide 开始,但我似乎无法获得 运行 的第一段代码。 RegistrationBuilder 根本不存在,而且我似乎没有它应该位于的 System.ComponentModel.Composition.Registration 命名空间。

我所做的只是很好地安装了 Microsoft.Composition package from Nuget. I'm able to find the classes in the System.Composition 命名空间,但这似乎还不足以开始。

我正在使用 Visual Studio Professional 2013 和 .NET 4.5.1。该项目是一个控制台项目(虽然我也尝试了一个Windows项目),虽然最终目标是在ASP.NET.

中使用这个

我还需要做什么才能使 MEF2 正常工作?

我不得不从添加引用菜单 (doh) 添加 System.ComponentModel.Composition.Registration 程序集。