Type Reason ArgumentNullException obj is a null reference. InvalidOperationException The caller of this method is not the same as the object passed to this method.
This method sets a bit in the object header of obj, which the runtime checks when calling finalizers. A finalizer, which is represented by the object.Finalize method, is used to release unmanaged resources before an object is garbage-collected. If obj does not have a finalizer, the call to the GC.SuppressFinalize(object) method has no effect.
Objects that implement the IDisposable interface can call this method from the object's IDisposable.Dispose implementation to prevent the garbage collector from calling object.Finalize on an object that does not require it. Typically, this is done to prevent the finalizer from releasing unmanaged resources that have already been freed by the IDisposable.Dispose implementation.