When GC.KeepAlive Doesn’t

The purpose of GC.KeepAlive(Object) is to tell the GC not to collect an object until a certain point.  For example: class MyObject{   ~MyObject()   {   Console.WriteLine(“MyObject Finalized”);   }                 public static void Main()   {      MyObject obj = new MyObject();      LongRunningMethod();      GC.KeepAlive(obj); // ~MyObject will NOT be run before this call      …   }} KeepAlive will ensure ~MyObject will not get run before LongRunningMethod gets called.  This is useful…

6