Dependency On Newtonsoft.Json

Hi guys,
I noticed the latest version (1.1.0 preview) has a dependency on JSON.NET.
I have a third party plugin that I am currently using that depends on an older version of JSON.NET, and updating to the latest version of Remote Config causes it to fail to load.

It looks like a possible way to resolve this in a Visual Studio is to use dependency redirects in the app config, but I can’t seem to figure out how to do this in unity or if it is even possible?

What plugin is causing the issue? Have you contacted them?

I think I figured out the solution. Posting it here for anybody who has the same problem

  1. Add the line:
-appconfig:app.config

to the csc.rsp file

  1. Create a file called “app.config” in the root of your project (above assets folder)
    with this in it:
<?xml version="1.0" encoding="utf-8"?>
<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-12.0.0.0" newVersion="12.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

This will redirect any plugin that depend on an older version of JSON.NET (0-12) to use the newer version included with Remote Config (com.unity.nuget.newtonsoft-json 2.0.0-preview)

In my case, I was using Google APIs in my editor tools & Google.Apis.Core depends on JSON.Net v10.

12 Likes