views:

125

answers:

1

I have multiple services that is pulling an assembly from the GAC. When I install one of these services it is updating the GAC with a new assembly that is shared by various services, and inserts a new policy file into the GAC so that all previous versions look for the new assembly. All the services pick up on the policy without restarting the service and uses the new assembly perfectly. The problem and question arises is when I roll back this release, and uninstall the assembly and policy and restart the service related to installing the new assembly. Obviously the restarted service picks up the previous version of the assembly in the GAC. But the other services that are running on the server that use this assembly are still binded to the new version of the assembly from the policy file. My questions are:

Is the binding like a cache where it will eventually release it and pick back up on the old assembly? or will it stay binded until the service restarts?

If it requires a restart is there anyway besides locating all the services that use this assembly and restarting those services, or restarting the server itself to remove the blinding to the assembly that has been removed from the GAC?

+1  A: 

The .NET runtime does not unload an assembly until the application domain is shut down (typically when the process exits but its possible to create multiple application domains in a single process).

I think you will need to shut down the other services, remove the policy file and the new assembly, then restart all the services involved.

Brian Ensink