Problems in loading a Non-GAC version of Assembly

  • Thread starter Thread starter Amruta
  • Start date Start date
A

Amruta

Hi,
I have an Assembly version 1.1.8.1 in the GAC.My problem is that I want
to use an assembly with the same version outside GAC.
I have tried using <codebase> element by specifying the path to the
required Assembly,but the CLR is still loading the Assembly from the
GAC.
<configuration>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="AssemblyTest"
publickeyToken="ebf3388bf6e61e92" culture="neutral"/>
<codebase version="1.1.8.1" href="FILE://C:/......dll"/>
</dependentAssembly>
</assemblyBinding>
</configuration>

Any advice or tips would be greatly appreciated.
Thanks in Advance.
 
CLR first searches the GAC when trying to load an assembly.. I am not really
sure you can load a strong named assembly with the same version from a
private folder if its allready installed in GAC.

But I heard some folks were able to achieve this with "LoadWithPartialName"
method in 1.1. You might wanna give a try
 
Hey,
Thanks for the reply. I have tried using Assembly. Load Method. However
I was thinking more on the lines of making changes in the app.config
file to load the desired version of the assembly. Any idea on how I can
do that?
Thanks,
Amruta
 
As I said before.. no matter what kind of configuration you have in your
configuration files, CLR will load the GAC version of the strong named
assembly, if the private and GAC versions have the same version number. The
best way to avoid this problem is to use different version number each time
the assembly is changed
 
Hi Amrutha,
I am not sure if you are still having the issue, but I read somewhere
that, if you use LoadFile methomd, then CLR loads the assembly from the
specified path with applying any policies or searching in GAC.
 
Back
Top