tnw
tnw

Reputation: 13877

'ObservableCollection' could not be found even when using 'System.Collections.ObjectModel'

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

Upvotes: 2

Views: 5456

Answers (1)

Thomas Levesque
Thomas Levesque

Reputation: 292465

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")

Upvotes: 7

Related Questions