Original: Failed to load file or assembly Newtonsoft.json, version=4.5.0.0 error, workaround
The client error when testing Webapi with HttpClient:
{"Failed to load file or assembly" Newtonsoft.json, version=4.5.0.0, culture=neutral, publickeytoken=30ad4fe6b2a6aeed "or one of its dependencies.) The found assembly manifest definition does not match the assembly reference. (Exception from hresult:0x80131040) ":" Newtonsoft.json, version=4.5.0.0, Culture=neutral, Publickeytoken=30ad4fe6b2a6aeed "}
The problem is that because of the System.Net.Http.Formatting and json.net version conflicts, it's good to redirect the json.net version in App. Config.
<?xml version= "1.0" encoding= "Utf-8"?><configuration> <startup> <supportedruntime version="v4.0" sku=". netframework,version=v4.5 " /> </startup> <runtime> <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 "/> </dependentassembly> </assemblybinding> </Runtime></configuration>
Failed to load file or assembly Newtonsoft.json, version=4.5.0.0 error, workaround