我正在处理我在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