Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI
In my current project we are using Microsoft.Practices.EnterpriseLibrary.Data.dll version 5.0.505.0, but in my computer GAC has 5.0.414.0 version of the same dll. while running my application it refers GAC assembly . But i need to refer higher version dll which is available in my bin folder .here i marked copy to local option as true.

Note : uninstalling is not an option since i need to keep older version in my GAC .

so far i tried the below configurations in my web.config:
HTML
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
           <probing privatePath="bin"/>
  <dependentAssembly>
    <codeBase version="5.0.505.0" href= "file:///D:\TestSQL\TestSQL\bin\Debug\Microsoft.Practices.EnterpriseLibrary.Data.dll"/>
    <assemblyIdentity name="Microsoft.Practices.EnterpriseLibrary.Data"
                      publicKeyToken="31bf3856ad364e35"
                      culture="neutral" />
    <probing privatepat="bin"></probing>
    <bindingRedirect oldVersion="5.0.414.0"
                     newVersion="5.0.505.0"/>
  </dependentAssembly>
</assemblyBinding>
</runtime>


its giving neagtive results
Posted
Comments
Sergey Alexandrovich Kryukov 18-Jun-14 13:23pm    
What negative results? Of course, you need to use only one version.
—SA

1 solution

Usually, two different versions of the product can work in the same GAC side-by-side. In your case, this is especially simple: you can use only one version of the product installed in GAC. In case of using a GAC assembly, when you add a reference (with Visual Studio, using the ".NET" tab of the "Add Reference" window), you actually reference that assembly by that strong name which includes the version and the public key token; both should be different for different version.

You can simply install the second version of the product in the GAC and use either one or another. In worst case, you can even temporary unregister one of the version from GAC and register it later; you won't need to permanently remove the version. Besides, you can always use the installation packages.

Please see: http://msdn.microsoft.com/en-us/library/ex0ss12c%28v=vs.110%29.aspx[^].

See also: http://msdn.microsoft.com/en-us/library/8477k21c%28v=vs.110%29.aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900