Testing code that uses WeakReference failed for me using Mono 2.11.3 (SGen) as well as the stable 2.10.8 version. In a simple code like this
object obj = new object();
WeakReference wr = new WeakReference(obj);
Assert.IsTrue(wr.IsAlive);
obj = null;
GC.Collect();
Assert.IsFalse(wr.IsAlive);
the second assert will fail. Adding GC.WaitForPendingFinalizers doesn't help. Is this a bug in Mono or in my head? Thanks