Skip to content

Add net9.0 and net10.0 target frameworks#1089

Closed
fdcastel wants to merge 1 commit intoaaubry:masterfrom
fdcastel:feature/add-net9-net10-targets
Closed

Add net9.0 and net10.0 target frameworks#1089
fdcastel wants to merge 1 commit intoaaubry:masterfrom
fdcastel:feature/add-net9-net10-targets

Conversation

@fdcastel
Copy link
Copy Markdown
Contributor

Summary

Add net9.0 and net10.0 to the TargetFrameworks list for both the YamlDotNet library and YamlDotNet.Test projects.

Changes

New target frameworks

  • Library: net10.0;net9.0;net8.0;net6.0;netstandard2.0;netstandard2.1;net47
  • Tests: net10.0;net9.0;net8.0;net6.0;net47

OrderedDictionary ambiguity fix

.NET 9 introduced System.Collections.Generic.OrderedDictionary<TKey, TValue>, which conflicts with YamlDotNet.Helpers.OrderedDictionary<TKey, TValue>. This caused CS0104 ambiguity errors when compiling for net9.0+.

Fixed by using fully qualified type names:

  • YamlMappingNode.csHelpers.OrderedDictionary<YamlNode, YamlNode>
  • OrderedDictionaryTests.csYamlDotNet.Helpers.OrderedDictionary<int, string>

Files Changed

  • YamlDotNet/YamlDotNet.csproj
  • YamlDotNet.Test/YamlDotNet.Test.csproj
  • YamlDotNet/RepresentationModel/YamlMappingNode.cs
  • YamlDotNet.Test/Helpers/OrderedDictionaryTests.cs

Test Results

  • net9.0: 1845 passed, 4 failed (pre-existing locale-dependent float formatting failures, also present on net8.0)
  • net10.0: 1845 passed, 4 failed (same pre-existing failures)

@fdcastel fdcastel marked this pull request as draft March 26, 2026 18:22
@fdcastel
Copy link
Copy Markdown
Contributor Author

fdcastel commented Mar 26, 2026

AppVeyor's Visual Studio 2022 image only has .NET SDK 9.0.x installed, which cannot target net10.0 (NETSDK1045).

Fix

Added a dotnet-install.ps1 step to install the .NET 10 GA SDK before the build:

install:
  - cmd: git submodule update --init
  - ps: |
      Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1'
      .\dotnet-install.ps1 -Channel 10.0 -InstallDir "$env:ProgramFiles\dotnet"
  - cmd: |
      dotnet tool install --global GitVersion.Tool --version 6.5.1
      dotnet tool restore

Add net9.0 and net10.0 to both the library and test project TargetFrameworks.

Fix OrderedDictionary ambiguity for net9.0+: .NET 9 introduced
System.Collections.Generic.OrderedDictionary<TKey, TValue> which conflicts
with YamlDotNet.Helpers.OrderedDictionary<TKey, TValue>. Disambiguate by
using fully qualified type names in YamlMappingNode.cs and
OrderedDictionaryTests.cs.

Update appveyor.yml to install the .NET 10 SDK and add artifact paths for
the new target frameworks.
@fdcastel fdcastel force-pushed the feature/add-net9-net10-targets branch from 2c1d6c2 to b728f0f Compare March 26, 2026 18:38
@fdcastel fdcastel marked this pull request as ready for review March 26, 2026 18:38
@EdwardCooke
Copy link
Copy Markdown
Collaborator

This is fixed in #1092

@EdwardCooke EdwardCooke closed this Apr 9, 2026
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.

2 participants