1

我的项目设置为 .NET Framework 4.5。尝试在我的 WPF 项目中使用 SimpleIOC(来自 MVVM Light)时出现以下错误:

Error 3 Reference required to assembly 'System.ComponentModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' containing the implemented interface 'System.IServiceProvider'. Add one to your project.

我不知道为什么它给了我这个错误。据我了解,这是一个 mscorlib 类,所以我不确定它是从哪里获取 System.ComponentModel 的。

我可以Dim test As IServiceProvider在没有编译器抱怨的情况下编写。是否存在某种版本问题?

4

1 回答 1

0

这似乎是一个可能的 Visual Studio 错误。我创建了一个新的 WPF 项目,并且能够在 .Net Framework 程序集列表中找到 System.ComponentModel.dll。对于我当前的项目,我最终浏览到它以添加对它的引用。现在一切都很好。

于 2014-12-19T03:02:16.363 回答