none
COM Server process compiled with /clr option doesn't unload itself from memory when last COM client disconnected and WCF service stopped RRS feed

  • Question

  • I created Visual C++ ATL project in VS2010, exe type, imlemented COM object, then added /clr option to project. Project uses other C# dlls (WCF service). When last COM client disconnects and last COM object instance destroys, WCF service stopped, my COM server process doesn't unload itself from memory. All managed threads in C# dll are background, COM object doesn't create threads. How can I unload server process? Thank you in advance. 
    • Changed type ru_Val Wednesday, October 13, 2010 7:58 AM
    Saturday, September 11, 2010 6:17 PM

All replies

  • Use

     System.Runtime.InteropServices.Marshal.ReleaseComObject(youCOMObject);

    Saturday, September 11, 2010 6:25 PM
  • All COM objects on my Server Released, but server process doesn't unload itself from memory. When new COM client connects to my COM server, new server process launches, so 2 COM server processes coexist. This is undesired behavior, I need only one server process.
    Saturday, September 11, 2010 6:31 PM