How to force third party assembly to use new version of dependency

61 Views Asked by At

I have a third party assembly System.Net.Http.Formatting.dll, which depends on Newtonsoft.Json, version=6.0.0.0. My application has reference for both assembly, but with Newtonsoft.Json, version=13.0.0.0. I try to use app.config to rebind Newtonsoft.Json to 13.0.0.0:

<configuration>  
   <runtime>  
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">  
         <dependentAssembly>  
            <assemblyIdentity name="Newtonsoft.Json"  
                              publicKeyToken="30ad4fe6b2a6aeed"  
                              culture="neutral" />  
            <bindingRedirect oldVersion="0.0.0.0-13.0.0.0"  
                             newVersion="13.0.0.0"/>  
         </dependentAssembly>  
      </assemblyBinding>  
   </runtime>  
</configuration>  

But it still tries to load 6.0.0.0 of Newtonsoft.Json when System.Net.Http.Formatting is loaded. Is there anyway to force System.Net.Http.Formatting to use 13.0.0.0?

0

There are 0 best solutions below