Problems in loading a Non-GAC version of Assembly

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.
 
K

Kumar Reddi

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
 
A

Amruta

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
 
K

Kumar Reddi

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
 
K

kumarreddi

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top