i'am new to Nini but i thought to understand it.
But i have a problem i could not figure out.
As long as the INI-file and the entry exists all is ok.
But when the INI-file not exists trying
source = new IniConfigSource(strConfigFile);
crashes. Same when the section or key not exists
return source.Configs.GetString(strKey, strDefault);
crashes, although a given defaultvalue.
Is'nt it so that Nini creates a empty config-class and saves it
on request to the given filename?
And the GetString with given default should not crash in my
opinion if the section/key not exists. Am I wrong?
Any suggestion what is going wrong here?
P.S. source.AutoSave is set to true;
Greetings
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello together,
i'am new to Nini but i thought to understand it.
But i have a problem i could not figure out.
As long as the INI-file and the entry exists all is ok.
But when the INI-file not exists trying
source = new IniConfigSource(strConfigFile);
crashes. Same when the section or key not exists
return source.Configs.GetString(strKey, strDefault);
crashes, although a given defaultvalue.
Is'nt it so that Nini creates a empty config-class and saves it
on request to the given filename?
And the GetString with given default should not crash in my
opinion if the section/key not exists. Am I wrong?
Any suggestion what is going wrong here?
P.S. source.AutoSave is set to true;
Greetings
It sounds like your application might not have write permission to the INI file.
It should throw a stack trace. Please post if if you have further problems.