How to root cause why COM+ is locking DLLs?

59 Views Asked by At

I have an application that has to be installed in COM+. Installation via RegSvcs works fine, however when I try to uninstall the application a number of DLLs are locked and remain in the install folder. Note that this only happens after I make a call to the COM+ application; otherwise the uninstall runs smoothly.

My application requires a clean install and backout, but I'm having difficulty identifying why these DLLs are getting locked. A screenshot of the locked third-party DLLs is found below; the two corresponding to my application are not shown.

My assembly is marked as non-ComVisible, with a single class deriving from ServicedComponent exposed to COM+. I've tried forcing garbage collection after the call completes, but it doesn't seem to make any difference. So, some questions:

  • Is it safe to assume this is happening due to improper implementation of IDisposable somewhere, or could it be something else?
  • Should I assume there is a separate problem pertaining to each locked DLL, or is it possible that there is a problem with a single class that is resulting in a lock on all these DLLs?
  • Any suggestions how I might go about debugging this?

Any assistance would be greatly appreciated - feeling completely lost on this one.

Locked DLLs

1

There are 1 best solutions below

0
ket On

I got it ... I needed the following attributes:

[assembly: ApplicationAccessControl(Value=false, AccessChecksLevel=AccessChecksLevelOption.ApplicationComponent)]
[assembly: ApplicationActivation(ActivationOption.Server)]

Calls get routed into my application from a system account, but without the second attribute it was apparently activated under the creator process.