- Home /
System.Collections.ObjectModel.Collection does not contain a definition for "Items"?
I'm following this article on how to build a Binary Tree in C# from msdn:
http://msdn.microsoft.com/en-US/libr...(v=vs.80).aspx
But in Unity my code is producing the following error:
error CS0117: 'System.Collections.ObjectModel.Collection >' does not contain a definition for 'Items'.
The offending code:
using System.Collections.ObjectModel;
public class NodeList<T> : Collection<Node<T>>
{
public NodeList() : base() { }
public NodeList(int initialSize)
{
for (int i = 0; i < initialSize; i++)
base.Items.Add(default(Node<T>));
}
....
}
Its the last line, which doesn't recognize Items from the Collection class, even though it has Items: http://msdn.microsoft.com/en-us/library/ms132397.aspx
Also its not producing an error in visual studio... only the Unity editor. Is this a bug in the Unity editor or something of my own? Could someone try to reproduce this for me?
Answer by $$anonymous$$ · Feb 23, 2013 at 04:12 AM
There is actually no current way to do what you are trying to do because unity only supports .net 3.5 and what you are trying to do requires 4.0 sorry :/