问题
System.Collections.ObjectModel is included. Visual studio 2012 still says Type or namespace name 'ObservableCollection' could not be found.
Similar to this question
Code:
class ObservableClass : ObservableCollection<OtherClass>
{
}
EDIT: This is .NET Framework 3.5 and is a console application
回答1:
You're probably missing an assembly reference... depending on which framework you are targeting, this class might be found:
- 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")
来源:https://stackoverflow.com/questions/12570902/observablecollection-could-not-be-found-even-when-using-system-collections-ob