2

System.Collections.ObjectModel已经包括了。Visual Studio 2012 仍然说Type or namespace name 'ObservableCollection' could not be found.

类似于这个问题

代码:

class ObservableClass : ObservableCollection<OtherClass>
{
}

编辑:这是 .NET Framework 3.5,是一个控制台应用程序

4

1 回答 1

6

您可能缺少程序集参考...根据您所针对的框架,可能会找到此类:

  • 在 WindowsBase.dll (.NET 3.x) 中
  • 在 System.dll (.NET 4.x)
  • 在 System.Windows.dll (Silverlight/Windows Phone 7)
  • 在 System.ObjectModel.dll (WinRT) 中(包含在“.NET for Windows Store apps”中)
于 2012-09-24T18:47:18.383 回答