I'm using JSON.NET to serialize class objects to a .txt file using:
public static void SaveDataToFile<T>(T data, string directory)
{
JsonSerializerSettings settings = new JsonSerializerSettings {NullValueHandling = NullValueHandling.Ignore, TypeNameHandling = TypeNameHandling.All };
//Save as JSON string to file
System.IO.File.WriteAllText(directory, JsonConvert.SerializeObject(data, typeof(T), settings));
}
But the .txt file has null/no data inside (viewing in Notepad++):
What would make a serialized object have data like this?