This is a migrated thread and some comments may be shown as answers.

Getting "Could not load file or assembly Newtonsoft.Json ..." when trying to save spreadsheet

1 Answer 2371 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Giorgos
Top achievements
Rank 1
Giorgos asked on 14 Apr 2020, 09:21 AM

I'm using RadSpreadsheet control in one my my asp.net web forms page. Everything works as expected when I debug the application from Visual Studio. But when I deploy the application to IIS the Save operation fails with the message attached.

I have been using Newtonsoft.Json package long before I added the spreadsheet functionality and never had a similar problem with it. What could be the cause of this error?

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

1 Answer, 1 is accepted

Sort by
0
Giorgos
Top achievements
Rank 1
answered on 14 Apr 2020, 10:38 AM

I solved the problem by adding the following lines to web.config:

<dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="12.0.0.0" />
 </dependentAssembly>


 

 

Tags
Spreadsheet
Asked by
Giorgos
Top achievements
Rank 1
Answers by
Giorgos
Top achievements
Rank 1
Share this question
or