graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

When installing in Unity LTS there are Newtonsoft.json conflicts

Open pixelpax opened this issue 1 year ago • 0 comments

Installing through nuget for unity, latest version of graphql-client, we get

precompiled assemblies with the same name Newtonsoft.Json.dll included on the current platform. Only one assembly with the same name is allowed per platform.
<project>/Library/PackageCache/[email protected]/Runtime/Newtonsoft.Json.dll

When I try removing either of these .dlls, it barfs, saying

TypeLoadException: Invalid type GraphQL.Client.Http.GraphQLHttpClient for instance field DataSubscriptionManager+<GetRemoteSeshState>d__3:<gqlCli>5__2
(wrapper write-barrier) System.Object.wbarrier_conc(intptr)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <1fe4b731108247d3a7e57fad336611b9>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.

How can I redirect graphql-client to use the internal version of newtonsoft.json?

This is using Unity 2021.3.6f1 and the latest graphql-client

pixelpax avatar Nov 02 '22 21:11 pixelpax