I had just the same problem in Visual Studio 2015. But Utamaru's solution worked for me.
Make a folder: Assets/Plugins where you put the *.dll file and add it as a reference.
To add a reference you highlight the Analyzers in the Solution Explorer in Visual Studio and under Project > Add Reference you can find your *.dll file located in Assets/Plugin by browsing to it.

c# - Adding Json.Net to a Unity3D project - Stack Overflow
Newtonsoft Json package - Unity Engine - Unity Discussions
Trying to use NewtonSoft.Json or Unity.Newtonsoft.Json, getting an installation error.
Newtonsoft Json package - Unity Engine - Unity Discussions
Videos
I had just the same problem in Visual Studio 2015. But Utamaru's solution worked for me.
Make a folder: Assets/Plugins where you put the *.dll file and add it as a reference.
To add a reference you highlight the Analyzers in the Solution Explorer in Visual Studio and under Project > Add Reference you can find your *.dll file located in Assets/Plugin by browsing to it.

For support in built versions, recommended to use one of following
Json.NET v13.0github.com/jilleJr/Newtonsoft.Json-for-UnityJson.NET v9.0github.com/SaladLab/Json.Net.Unity3DJson.NET v8.0parentelement.com/assets/json_net_unityJson.NET v7.0nuget.org/packages/Unity.Newtonsoft.Json/
Or if you dont require Newtonsoft.Json (Json.NET), here's some other alternatives (all works in Unity, I've omitted libraries that don't, and there's a lot of 'em):
OdinSerializergithub.com/TeamSirenix/odin-serializerUTF8Jsongithub.com/neuecc/Utf8JsonFastJSONassetstore.unity.com/packages/tools/input-management/fastjson-27220UltimateJsonassetstore.unity.com/packages/tools/integration/ultimate-json-60845SimpleJsonwiki.unity3d.com/index.php/SimpleJSONLitJsongithub.com/Mervill/UnityLitJsonFullSerializergithub.com/jacobdufault/fullserializerprotobuf-netgithub.com/protobuf-net/protobuf-net
There is quite the table of candy to select from. Choose well young padawan~
I know Newstonsoft.Json doesn't work with Unity projects, but someone made a UnityJson, and it's giving me the same error.
Could not install package 'Unity.Newtonsoft.Json 7.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v3.5,Profile=Unity Full v3.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. 0
Using the NET 2.0 DLL since Unity doesn't support any higher. With the following code:
using Newtonsoft.Json;
public static class ItemDatabase {
public static void Test() {
ItemData boots = new ItemData {
name = "Boots",
description = "Keeps your feet warm",
sprite = "boots"
};
ItemData[] dataArray = { boots };
int[] intArray = { 1 };
JsonConvert.SerializeObject(boots); // works
JsonConvert.SerializeObject(dataArray); // crashes
JsonConvert.SerializeObject(intArray); // works
}
}
public struct ItemData {
public string name;
public string description;
public string sprite;
}When I serialize "ItemData" it works fine, but when I serialize an "ItemData" array Unity crashes. The log it dumps is cryptic so I don't know what's happening. I'm sure there are others out there using JSON.NET because that's what I see recommended here often, any ideas?