R – Is it possible to install an assembly into the GAC as some sort of ‘linked assembly’

app-configframeworksgac

I'm trying to deploy some sort of framework and therefore need to register some assemblies in the GAC.

The interesting part is:
These GAC assemblies should only be used by the framework developer, the client apps should not use these GAC assemblies but the ones in their local directories (the GAC assemblies could be of a different version, most likely higher).

I've already found and tried the app.config setting but it seems to be ignored by the client app (latest .NET runtime installed is 3.5).

Best Answer

Because you will be loading two different versions of a given dll in the memory you need to isolate them. common methods are;

  1. Creating an AppDomain. You create two dll's. The first dll creates a new AppDomain from your code and then loads the second dll which is linked to those dependencies.
  2. Use a service process. You create one dll and a service application. The dll starts the service application in a new process and connects using for e.g. remoting. The service application is linked to the components you need to bind to.
Related Topic