AddRef/Release monitoring in C#

Nov 13, 2014 at 3:45 PM

I am responsible for developing a COM Server in C# that is dynamically registered by the client passing a clsid as a command line parameter.

All of this is working fine except that my COM Server is not closing down after the client has called Release() on its COM object.

Ideally, I would like to implement AddRef and Release to terminate my message pump in the COM Server when the reference count goes to zero...
...or discover that there is a better way of doing this to make sure the final Release() call turns out the lights.

Can you suggest anything?