いくつかの構成情報を保存しようとしていますが、IsolatedStorage内でNINIライブラリとファイルを使用したいと思います。理由はわかりませんが、構成を保存しようとすると、NiniSaveメソッドで次の例外が発生しました。この状態ではソースを保存できません。
コードは次のとおりです。
isf = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly | IsolatedStorageScope.Domain, null, null);
var isfs = new IsolatedStorageFileStream("file.ini", FileMode.Create, isf);
//Stream s = new StreamWriter(isfs);
IConfigSource mainSource = new IniConfigSource(isfs);
var config1 = mainSource.Configs["General"];
if (config1 == null)
{
mainSource.AddConfig("General");
config1 = mainSource.Configs["General"];
}
config1.Set("CW", CommentWidth);
mainSource.Save();
isfs.Close();
例外はmainSource.Save()で発生します。。何か案は?