I used nuget to install Json.NET into my Unity project but the issue is when I launch it throws
The type or namespace 'Newtonsoft' could not be found. Are you missing a using directive or an assembly reference
Yet it is in my references and I have using Newtonsoft.Json;
I have looked at other questions but I could not an answer which worked. I am using Unity 5 and the latest version of Json.NET
The package is not supported by Unity as in if there are problems with the actual functionality of newtonsoft json, Unity won't help you with that. Because it is a third party library.
The Newtonsoft. JSON namespace provides classes that are used to implement the core services of the framework. It provides methods for converting between . NET types and JSON types.
1.In Unity, place the Newtonsoft.Json.dll
file into the Assets/Plugins
folder
2.In Visual Studio, highlight Analyzers
in the in Solution Explorer
window.
3.Go to Project
-> Add Reference
and choose your project directory followed by Assets/Plugin
. That's it.
Optional:
In Unity 5.3, Unity added native support of Json
serialization. You can simply use that to convert to Json
and back to class
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With