Skip to content

Write to CSV: move to CsvHelper 34 and net11.0 - #2456

Merged
vladimir-pecanac-main merged 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/61462-csvhelper-34
Dec 1, 2026
Merged

vladimir-pecanac-main merged 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/61462-csvhelper-34

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

CsvHelper 34 replaced the writer API, so the sample no longer compiled against the current package. The sample, its record map and its tests now use CsvWriter.ToFile, CsvWriter.Create, CsvWriterOptions and the Csv* attributes, and the projects target net11.0. Local run: 11 of 11 tests pass.

CsvHelper 34 replaced the writer API, so the sample stopped compiling
against the current package.

- CsvWriter.ToFile and CsvWriter.Create with CsvWriterOptions replace
  new CsvWriter(writer, culture) and CsvConfiguration
- Person, Contact and Employee are [CsvRecord] partial classes;
  [CsvColumn], [CsvFormat], [CsvCulture], [CsvBooleanValues],
  [CsvConstant], [CsvNullValues] and [CsvIgnore] replace the old
  attributes, and [CsvOptions] with CsvWriterOptions.For<T>() replaces
  the class-level Delimiter and HasHeaderRecord
- PersonMap is a [CsvRecordMap] class over a class we cannot annotate
- Employee's salary uses [CsvCulture("de-DE")]: [CsvFormat] now applies
  to dates and times only
- New tests: the culture no longer changes the separator, and
  CsvInjection.Escape guards formulas
- net10.0 to net11.0
@vladimir-pecanac-main
vladimir-pecanac-main merged commit 5d04768 into CodeMazeBlog:main Dec 1, 2026
4 checks passed
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

Successfully merging this pull request may close these issues.

1 participant