Is that really true that in an in-proc C# assembly the Finalize
methods are not called when COM objects are destroyed from the caller?
And if so, is there any solution for this problem? Or the only one is
to define a "Cleanup()" method and tell all users to call it and hope
they will?
I'm using .NET 2.0 and the C# DLL is called from a .vbs file (WSH)
(and it's called with a help of a DLL Surrogate, because I want it to
be available via DCOM)
Sheng Jiang[MVP] - 20 Jul 2007 19:17 GMT
I am calling Marshal.ReleaseComObject every time finished using a com object
from a method call, usually in a finally block to avoid leaking COM objects
when an exception is thrown.

Signature
Sheng Jiang
Microsoft MVP in VC++
> Is that really true that in an in-proc C# assembly the Finalize
> methods are not called when COM objects are destroyed from the caller?
[quoted text clipped - 5 lines]
> (and it's called with a help of a DLL Surrogate, because I want it to
> be available via DCOM)