I am writing a windows forms application (in C# targetting .NET v2 x86), that instanciates a COM object by its ProgID, calls a few methods on it to check its version , and then disposes it (with the dispose interface that the DisposeableCOMProxy provides).
Based on the method calls to the COM object, my program will download and run an MSI that updates the dll that contains the COM object (should an update be required). The MSI is set to remove previous versions, and all this happens automatically.
My problem is that the MSI shuts down my forms application because it claims that it still has a handle on the dll - the below is an excerpt from the msi verbose log:
MSI (s) (40:74) [14:38:06:141]: RESTART MANAGER: Will attempt to shut down and restart applications in no UI modes.
MSI (s) (40:74) [14:38:06:141]: RESTART MANAGER: Detected that application with id 3676, friendly name 'MyApp', of type RmUnknownApp and status 1 holds file[s] in use.
The MSI only contains one file, and thats the dll file that the DisposableCOMProxy used when i instanciated the COM Object with the progid.
Ive tried explicitly calling GC.Collect() and subsequently calling GC.WaitForPendingFinalizers()
None of this works!
How can I remove the "lock" on this file? is it even a lock?
Is this an issue
View Complete Post