How to reference Newtonsoft.Json in Godot (C#)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By duendecat

Hi,

I’m trying to include Newtonsoft.Json in my project so that I can save/load game data as json files, but so far have been unable to include the .dll in my project. I’m using the C#/Mono version of Godot on Linux (using sublime text) and so far I have found absolutely nothing online or in the documentation on how to do this.

Has anyone else successfully been able to get this working? If so, I’d be very grateful if you could kindly give me a few pointers as to how to achieve this.

Thanks!

Richard

I imagine using any library in C# here is no different than the way you usually do it for any other C# application, is it? You have a solution file, a project file, so in your IDE you should be able to add a new reference to that library I think.
If not, maybe including the source files directly could work.

Zylann | 2019-09-15 18:39

:bust_in_silhouette: Reply From: LudditeGames

I’ve followed this page on the documentation to get this same Newtonsoft.Json library included in my project.

You basically install the external nuget package, then change the .csproj file to reference that file. This is how a standard C# project references external nuget packages.