0
votes

Whenver I update Newtonsoft.Json to version 10, I keep getting the following error when running DocuSign.eSign.dll

The type initializer for 'DocuSign.eSign.Client.Configuration' threw an exception. I: Could not load file or assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies.

The system cannot find the file specified.The type initializer for 'DocuSign.eSign.Client.Configuration' threw an exception. I: Could not load file or assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.

This is keeping me from updating other Nuget packages that I have.

2

2 Answers

1
votes

Try to add the following to the config file:

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

More details: https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/dependentassembly-element

0
votes

The DocuSign.eSign.dll (v2.1.4) depends on NewtonSoft.Json.dll (v8.0.3). So upgrading to version 10 will throw the compilation error.

Consider moving your other dependencies into a different project, that way you can upgrade the NewtonSoft.Json.dll in the specific project that needs the new version.