Is there any way to force my asp.net application to load the assembly from local bin directory since there is another older version of the assembly with the same name in the
Change the version number, strong name the assembly and reference the strongly named higher version you deploy with your solution.
The oldVersion configuration that is suggested by Muse VSExtensions works! You can use the strong name for the local assembly: Please look this page: http://msdn.microsoft.com/en-us/library/7wd6ex19.aspx
Basically in web.config add something like:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="DllName"
publicKeyToken="0123456789abc"
culture="neutral" />
<!-- Assembly versions can be redirected in app,
publisher policy, or machine configuration files. -->
<bindingRedirect oldVersion="2.0.0.0-2.5.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
That way if i have an assembly in the gac that can be from version 2.0.0.0 to version 2.5.0.0 all the calls would be redirected to the newVersion (3.0.0.0)
In the assemblies section I added the assembly:
<add assembly="DllName, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0123456789abc" />
And that's it.