JeevanJames / IniFile

.NET library to open, modify and save .INI files
Apache License 2.0
23 stars 12 forks source link

Calling the SaveToAsync function threw an exception #142

Open debugCode1024 opened 2 years ago

debugCode1024 commented 2 years ago

Hello, I have some problems during use. (1) Property Name Key under the same Section is not unique? (2) Calling the SaveToAsync function threw an exception. Can you help me with my doubts? thanks

` var ini = new Ini() { new Section("SectionName") { new Property("PropertyName_1", "A string value"), new Property("PropertyName_2", 10), new Property("PropertyName_2", DateTime.Now) // Property Name Key Not Unique ? } };

        string desktopDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
        string filePath = Path.Combine(desktopDirectory, "TestIni.ini");
        using var writer = new StreamWriter(filePath, false, Encoding.UTF8);
        ini.SaveToAsync(writer); // System.InvalidOperationException : The stream is currently in use by a previous operation on the stream.

`