Skip to content

Read from CSV: move to CsvHelper 34 and net11.0 - #2455

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

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

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

CsvHelper 34 replaced the reader API, so the sample no longer compiled against the current package (a reader reported CS1729 on the CsvReader constructor). The sample, its map and its tests now use CsvReader.FromFile, CsvReaderOptions, [CsvRecord], [CsvColumn] and [CsvRecordMap], and the projects target net11.0. Local run: 12 of 12 tests pass.

CsvHelper 34 replaced the reader API, so the sample stopped compiling
for anyone who installs the current package (CS1729 on the CsvReader
constructor).

- CsvReader.FromFile with CsvReaderOptions replaces new CsvReader(reader,
  configuration) and CsvConfiguration
- Person is a [CsvRecord] partial class with [CsvColumn(Index = n)]
- PersonMap is a [CsvRecordMap] class over a class we cannot annotate
- Tests cover the same traps on the new API: HasHeader left on, comment
  lines without CommentPrefix, OnRecordError (true now skips), separator
  detection, FormatProvider and the disposed reader
- net10.0 to net11.0
@vladimir-pecanac-main
vladimir-pecanac-main merged commit 785fe2a 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