I have developed a MVC application that has dependency on Connectwise SDK that uses Newtonsoft.Json.dll v6.0.0.0 and Dropbox SDK that uses Newtonsoft.Json.dll v7.0.0.0.
I need to ensure that my project uses the appropriate dll when needed. After researching, I tried the following: - Placed the 2 dlls under sub-folders /dlls/6.0.0.0/ and /dlls/7.0.0.0 resp. - Referenced version 6.0.0.0 dll in project References - Added to web.config
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"
culture="neutral" />
<bindingredirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"></bindingredirect>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"
culture="neutral" />
<bindingredirect oldVersion="7.0.0.0-7.1.0.0" newVersion="7.0.0.0"></bindingredirect>
<codeBase version="7.0.0.0" href="dlls/7.0.0.0/Newtonsoft.Json.dll" />
</dependentAssembly>
</assemblyBinding>
Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Is my href incorrect ?? dlls folder is in the same level as Content folder in MVC project
Thanks, Gagan
I had also hit the same issue. I solved using codebase methods mentioned in this link. https://devnet.kentico.com/articles/referencing-multiple-versions-of-the-same-assembly-in-a-single-application