Skip to content

Read and parse a JSON file in C#: retarget net10.0, add JsonNode and async methods - #2154

Open
vladimir-pecanac-main wants to merge 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/83203-read-json
Open

Read and parse a JSON file in C#: retarget net10.0, add JsonNode and async methods#2154
vladimir-pecanac-main wants to merge 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/83203-read-json

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Sample update for https://code-maze.com/csharp-read-and-process-json-file/

  • Both projects retargeted net7.0 -> net10.0 (net7.0 is out of support).
  • Package bumps: BenchmarkDotNet 0.15.8, Newtonsoft.Json 13.0.4, Microsoft.NET.Test.Sdk 18.9.0, xunit 2.9.3, xunit.runner.visualstudio 4.0.0, coverlet.collector 10.0.1.
  • The benchmark's data-file path was six .Parent hops deep, encoding BenchmarkDotNet's generated-project layout. Replaced with AppContext.BaseDirectory plus a copy-to-output item, which is depth-independent.
  • New UseJsonNodeWithSystemTextJson() (untyped JsonNode.Parse() route) and UseFileOpenReadAsyncWithSystemTextJson() (JsonSerializer.DeserializeAsync), with one test each.
  • Program.cs to top-level statements; Teacher.Courses property spacing.

Build clean and 8/8 tests pass on SDK 10.0.302 / .NET 10.0.10.

…async methods

- Both projects net7.0 -> net10.0
- BenchmarkDotNet 0.15.8, Newtonsoft.Json 13.0.4, Microsoft.NET.Test.Sdk 18.9.0,
  xunit 2.9.3, xunit.runner.visualstudio 4.0.0, coverlet.collector 10.0.1
- Benchmark data path from six .Parent hops to AppContext.BaseDirectory plus copy-to-output
- Add UseJsonNodeWithSystemTextJson() and UseFileOpenReadAsyncWithSystemTextJson(), one test each
- Program.cs to top-level statements; Teacher.Courses spacing
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