Unity 5.3 non-generic type error with WeakReference
<p>I'm using Unity 5.3.5f1 with Visual Studio Community 2015 and I keep getting the error: "The non-generic type `System.WeakReference' cannot be used with the type arguments" when I try to use a WeakReference with generics. I know that it is supported from <a href="https://msdn.microsoft.com/en-us/library/gg712738(v=vs.110).aspx" rel="nofollow">here</a>.</p>

<p>Snippet of my code:</p>

<pre><code>using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Collections;

namespace aim4.util
{
 /** The initial ID */
    private int initId;
    /** The next ID */
    private int nextId;
    /** A mapping from IDs to weak references of objects */
    private SortedDictionary&lt;int, WeakReference&lt;T&gt;&gt; idToObj =
      new SortedDictionary&lt;int, WeakReference&lt;T&gt;&gt;();
</code></pre>

<p>I have a feeling its related to Unity because if I load the script in VS outside of the project then it doesn't complain. Any help would be appreciated. Thanks.</p>