Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Question How to resolve conflicts (eg, Newtonsoft) in plugin?

Discussion in 'Package Manager' started by MrLucid72, Aug 1, 2022.

  1. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    887
    Since 9 out of 10 packages will use Newtonsoft, how the heck do plugin devs resolve dll dependencies?

    * Eg: Newtonsoft is everywhere in every package.
    * Eg: Unity <2019 doesn't include a bunch of core dlls, but 2020+ does.

    How to gracefully resoolve these as a plugin dev, where the current workaround is to get the end-user to scavenge through and delete 1 of them (which may cause issues for different versions).
     
  2. KirillKuzyk

    KirillKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    945
    There is an official Newtonsoft-json package available through the Unity Package Manager. It's intended for Unity's internal usage, so it's not visible through the UPM UI.
    But you can install it by adding the dependency manually to the Packages/manifest.json file:
    Code (CSharp):
    1. "com.unity.nuget.newtonsoft-json": "3.0.2"
    https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.0/manual/index.html

    If your Unity plugin is a UPM package, then you can add this dependency to the 'dependencies' section in the 'package.json' file of your package.
     
    MrLucid72 likes this.
unityunity