“的ObservableCollection'不能用'System.Collections.ObjectModel”时,竟然发现 [英] 'ObservableCollection' could not be found even when using 'System.Collections.ObjectModel'
本文介绍了“的ObservableCollection'不能用'System.Collections.ObjectModel”时,竟然发现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
System.Collections.ObjectModel
是包括在内。的Visual Studio 2012还称类型或命名空间名称的ObservableCollection'不能被发现。
System.Collections.ObjectModel
is included. Visual studio 2012 still says Type or namespace name 'ObservableCollection' could not be found.
到这个问题
代码:
class ObservableClass : ObservableCollection<OtherClass>
{
}
编辑:这是.NET Framework 3.5的,是一个控制台应用程序
This is .NET Framework 3.5 and is a console application
推荐答案
你可能缺少程序集引用...这取决于你的目标哪个框架,这个类可能是发现:
You're probably missing an assembly reference... depending on which framework you are targeting, this class might be found:
- 在WindowsBase.dll中(.NET 3.X)
- 在System.dll中(.NET 4.x版)
- 在System.Windows.dll中(的Silverlight / Windows Phone 7的)
- 在System.ObjectModel.dll(WinRT中)(包含在.NET的Windows Store应用程序)
- in WindowsBase.dll (.NET 3.x)
- in System.dll (.NET 4.x)
- in System.Windows.dll (Silverlight/Windows Phone 7)
- in System.ObjectModel.dll (WinRT) (included in ".NET for Windows Store apps")
这篇关于“的ObservableCollection'不能用'System.Collections.ObjectModel”时,竟然发现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文