Error: error CS0103: The name 'JsonConvert' does not exist in the current context
I have the latest Newtonsoft download and I cant figure out any way to fix this I've gone over about 50 different links all saying to install it. Which it is.
Am I missing something small? I am just trying to add my json elements to a list so I can use them in a program and then write back to the Json file. If this cant work can someone link or show me another way to do this in c#?
using System.IO;
using System.Collections.Generic;
using UnityEngine;
using Newtonsoft.Json;
namespace Newtonsoft.Json {
public class CustomControls : MonoBehaviour
{
private List<string> controls;
//public object JsonConvert { get; private set; }
// Start is called before the first frame update
void Start()
{
LoadJson();
for (int i = 0; i < controls.Count; i++)
{
Debug.Log(controls[i].ToString());
}
}
public void LoadJson()
{
using (StreamReader r = new StreamReader("CustomControls.json"))
{
string json = r.ReadToEnd();
controls = JsonConvert.DeserializeObject<List<string>>(json);
}
}
}
}