I have a "Shared" project where I share code between my client (unity) and my server (C# server)
Both projects require Newtonsoft.Json.dll
When I compile the Shared.dll and put it inside of Unity's Resources folder (so it's included in the build), I get this error :
PrecompiledAssemblyException: Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included or the current platform. Only one assembly with the same name is allowed per platform. Assembly paths:
Assets/Resources/Shared/Newtonsoft.Json.dll
C:/Users/rotmg/Documents/GitHub/AG-LNL/AG-LNL-Client/Library/PackageCache/com.unity.nuget.newtonsoft-json@2.0.0-preview/Runtime/Newtonsoft.Json.dll
I realise it's a conflict between Unity's dependency on Newtonsoft.Json and my Shared.dll's.
This answer :
https://answers.unity.com/questions/1697304/how-to-resolve-multiple-precompiled-assemblies-err.html
Says to use "merge all the dependencies into one .dll"
So I tried using Costura.Fody to build a single .dll that bundles all dependencies, but then I get an error saying that I should add references to the dependencies that Shared has. (NLog, BouncyCastle, etc.)
How can I resolve this conflict?



