
Calling COM EXE from VB.NET Service leaves COM EXE in Memory
Problem:
--------
Calling COM EXE from VB.NET Service leaves COM EXE in Memory long
after the Service has stopped.
Description:
------------
I have created a Windows Service in VB.NET that will call a COM EXE,
written in Visual Basic 6.0. Before calling the COM EXE I first
create a new thread and then call a method that calls the COM EXE.
Reason for creating the thread are two-folds (1) Windows Service main
thread does not get block (2) The COM EXE may takes up to 2 minutes to
run.
COM EXE:
"Single Use" Instancing (object of this class that a client creates
starts a new instance of the component)
Incorrect Behaviour:
--------------------
When I tell the service to stop, the COM EXE stays in memory for over
15 minutes before being released (observed in task manager). I even
call System.GC.Collect() to force the disposal of the .NET COM wrapper
objects, during the "OnStop" event of the service.
I am doing doing something wrong?
Thanks,
Kam Mistry