Can't seem to find consistent answers on the Internet. It looks like CLR GC makes a "decision" on whether to call destructors during garbage collection. This would imply that sometimes destructors won't be called. The way our legacy code base is structured, "using" blocks can't always be used, and the object instances do have certain resources that need to be released after object is no longer needed. I need a guaranteed way for GC to call a destructor. Would implementing IDisposable guarantee .Dispose being called on garbage collection? What is the best practice here?
I tried using ~ClassName(){ } and destructor doesn't always get called.