Skip to content

Calling the SaveToAsync function threw an exception #142

@debugCode1024

Description

@debugCode1024

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.

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions