While tracking down a problem and reading some stuff on garbage collection,I came across the GC.KeepAlive method. Looking at the example in the documentation really got me: In DoWork() the GC sometimes collects the Example object before the Hash property is finished executing. For me this looks like a bug in .NET.
Playing around with the example I found some interesting details: (more…)