在VS2012 </t,tmetadata>下使用MEF和Lazy <t,tmetadata>

时间:2014-05-21 21:42:01

标签: c#-4.0 visual-studio-2012 mef composition

我正在处理我在VS2010中编写的一些MEF代码,并在VS2012中再次编写代码。不幸的是,我陷入了这个简单的界面:

  public interface IModulesContainer
  {
    [ImportMany]
    IEnumerable<Lazy<IModule, IModuleMetadata>> Container { get; }
  }

VS2012对此有一个编译错误:

Error   Using the generic type 'System.Lazy<T>' requires 1 type arguments

我知道有两个System.Lazy&lt;&gt;泛型类,一个采用一种参数类型,另一种采用两种(第二种是元数据)。

我无法弄清楚如何让VS2012识别后一类。 (两者都在System命名空间下)

VS2010看起来很好。我错过了什么?

提前致谢, --Eric

0 个答案:

没有答案