We have 2 different applications (developed with .NET):
1st App: A Winservice.
2nd App: A Desktop App.
The Desktop App is loading the assembly from the GAC. The Winservice was in the past doing the same thing, but now we need that the Winservice loads THE SAME ASSEMBLY from another location.
But the GAC is winning and we can´t make this Winservice (using codebase in the app.config) to load the assembly. It always get the GAC´s one.
If we remove the GAC´s one. It works. But we need the other behavior. Desktop from the GAC and Winservice from the defined path in the codebase.
Is this possible without changing the version of the Assembly?
This is not possible without some kind of work around that modifies the assembly. In short, the GAC always wins. Period. If an assembly has a strong name the GAC is always checked first. Even if you load it into memory as a byte array and use Assembly.Load(byte[])
, the strong name will be checked and if it is a GAC'd assembly it gets loaded from the GAC.
A couple possible work arounds: