Closed ghost1372 closed 6 years ago
I can confirm it is a bug, the library should ensure the directory always exists and LoadNow()
should be able to handle empty config files or when they don't even exist.
Use it in the following manner:
class Program {
static Program() {
//Ensure the directory exists.
Directory.CreateDirectory(Path.GetDirectoryName(myPath));
Settings = JsonSettings.Load<SettingsBag>(myPath).EnableAutosave();
}
public static string myPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\MoalemYar\config.json";
private static SettingsBag Settings { get; }
static void Main(string[] args) {
Settings["testprop"] = 1;
Console.ReadLine();
}
}
Will fix it ASAP, thanks.
Fixed it. Will upload to nuget as version 1.0.2 soon. Closed.
hi i have static variable and i want use in json settings this is my code but not work