D David Browne Sep 15, 2003 #2 Li Pang said: Using the following codes: GC.Collect() GC.WaitForPendingFinalizers() Click to expand... This will work, but you should know that it freezes all the threads in your process for the duration of the GC.Collect(). So you should be very careful in running this in a multi-threaded environment such as COM+ or ASP.NET. System.Runtime.InteropServices.Marshal.ReleaseComObject(App) is probably all you need. This decrements the ref count on the COM object to 0, and invokes any destructors on the object. David
Li Pang said: Using the following codes: GC.Collect() GC.WaitForPendingFinalizers() Click to expand... This will work, but you should know that it freezes all the threads in your process for the duration of the GC.Collect(). So you should be very careful in running this in a multi-threaded environment such as COM+ or ASP.NET. System.Runtime.InteropServices.Marshal.ReleaseComObject(App) is probably all you need. This decrements the ref count on the COM object to 0, and invokes any destructors on the object. David