Closed ghost1372 closed 6 years ago
Hey Mahdi, could you please provide the stacktrace and the code you used to settings?
SettingsBag Settings { get; } = JsonSettings.Construct<SettingsBag>("config.json").EnableAutosave().LoadNow();
public MainWindow()
{
InitializeComponent();
Settings.AsDynamic().key = "wow"; //BOOM! SAVED!
Settings["key"] = "wow two"; //BOOM! SAVED!
}
Exception thrown: 'System.NullReferenceException' in nucs.JsonSettings.dll An exception of type 'System.NullReferenceException' occurred in nucs.JsonSettings.dll but was not handled in user code Object reference not set to an instance of an object.
just create new project and update jsonsettings to lattest version and you can see there is a problem This is a problem with version 1.0.4 Version 1.0.3 works well
Thanks for reporting,
I've fixed it - the file was opened using Truncute
and not OpenOrCreate
and therefore nothing was opened resulting in null.
I published it to release 1.0.5
.
Please confirm that it works for you.
tnx fixed
i updated my project library to 1.0.4 but i get error (if my config.json does not exist this happend) System.NullReferenceException: 'Object reference not set to an instance of an object.'