Could not load file or assembly 'Newtonsoft.Json, Version= when using Atlassian.SDK 10.6.0


My project is using Nuget package Atlassian.SDK 10.6.0. When calling

var jc = Atlassian.Jira.Jira.CreateRestClient(_jiraBaseUrl, _jiraApiUsername, _jiraApiPassword);

I have the error

System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=, 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)

My web.config already has the bindingRedirect

        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
        <bindingRedirect oldVersion="" newVersion=""/>

I also checked the fusion log

Calling assembly : Atlassian.Jira, Version=, Culture=neutral, PublicKeyToken=null.
LOG: This bind starts in default load context.
LOG: Using application configuration file: F:\Titan\AutoLedgers\Facade\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Newtonsoft.Json, Version=, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary

ASP.NET Files/facade/a6115f90/89f913a7/Newtonsoft.Json.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/facade/a6115f90/89f913a7/Newtonsoft.Json/Newtonsoft.Json.DLL. LOG: Attempting download of new URL file:///F:/Titan/AutoLedgers/Facade/bin/Newtonsoft.Json.DLL. LOG: Assembly download was successful. Attempting setup of file: F:\Titan\AutoLedgers\Facade\bin\Newtonsoft.Json.dll LOG: Entering download cache setup phase. LOG: Assembly Name is: Newtonsoft.Json, Version=, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed WRN: Comparing the assembly name resulted in the mismatch: Major Version ERR: The assembly reference did not match the assembly definition found. ERR: Setup failed with hr = 0x80131040. ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

I really have no idea how can I resolve this issue now. Does anyone has any idea?
asked on Stack Overflow Oct 4, 2019 by Kim Hoang

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0