Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling the SaveToAsync function threw an exception #142

Open
debugCode1024 opened this issue Sep 7, 2022 · 0 comments
Open

Calling the SaveToAsync function threw an exception #142

debugCode1024 opened this issue Sep 7, 2022 · 0 comments

Comments

@debugCode1024
Copy link

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.

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant