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

LeaveOpen removed from CsvConfiguration #2082

Open
crobibero opened this issue Nov 14, 2022 · 4 comments
Open

LeaveOpen removed from CsvConfiguration #2082

crobibero opened this issue Nov 14, 2022 · 4 comments
Labels

Comments

@crobibero
Copy link

crobibero commented Nov 14, 2022

Describe the bug
The property LeaveOpen was removed from the CsvConfiguration class.

To Reproduce
Attempt to update from 29.0.0 to 30.0.0.0 (or 30.0.1)

Expected behavior
LeaveOpen should be available.

Additional context
PR that removed the functionality: #1267
Specific commit: 283d68f

@crobibero crobibero added the bug label Nov 14, 2022
@OldrichDlouhy
Copy link

The changelog for version 30.0.0 incorrectly states in the breaking changes section that

Added bool LeaveOpen { get; } to IWriterConfiguration.
Added bool LeaveOpen { get; } to IParserConfiguration.

While the properties were in fact removed.

The LeaveOpen value is now passed directly via constructor for the parser and writer:

public CsvParser(TextReader reader, IParserConfiguration configuration, bool leaveOpen = false) { ... }

public CsvWriter(TextWriter writer, IWriterConfiguration configuration, bool leaveOpen = false) { ... }

@andres-olivares-ncontracts
Copy link

andres-olivares-ncontracts commented Jul 3, 2023

Does this update impact ExcelWriter? I updated from from CsvHelper 27.2.1 to 30.0.1, and when calling the following:

using var stream = new MemoryStream(); 
await using (var excelWriter = new ExcelWriter(stream, new CultureInfo("en-US"))) // Fails - Exception thrown: 'System.MissingMethodException' in CsvHelper.Excel.dll 
{ 
    await excelWriter.WriteRecordsAsync(collection); 
}

return stream.ToArray();

image

image

Don't know if this is the right place to post this, but it seemed related. Reverted back to CsvHelper 27.2.1 to keep it moving.

Thanks so much in advance,

@andres-olivares-ncontracts

Does this update impact ExcelWriter? I updated from from CsvHelper 27.2.1 to 30.0.1, and when calling the following:

using var stream = new MemoryStream(); await using (var excelWriter = new ExcelWriter(stream, new CultureInfo("en-US"))) // Fails - Exception thrown: 'System.MissingMethodException' in CsvHelper.Excel.dll { await excelWriter.WriteRecordsAsync(collection); }

return stream.ToArray();

image

image

Don't know if this is the right place to post this, but it seemed related. Reverted back to CsvHelper 27.2.1 to keep it moving.

Thanks so much in advance,

Has there been any movement on this issue?

@JoshClose
Copy link
Owner

A fix to this would be an update to the change log. That setting is on the Reader/Parser/Writer constructor.

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

No branches or pull requests

4 participants