Skip to content

Add a Roslyn 5.9 target - #1288

Merged
meziantou merged 1 commit into
mainfrom
feature/roslyn-5-9-target-81c974
Aug 17, 2026
Merged

Add a Roslyn 5.9 target#1288
meziantou merged 1 commit into
mainfrom
feature/roslyn-5-9-target-81c974

Conversation

@meziantou

Copy link
Copy Markdown
Owner

What

Adds roslyn5.9 as a supported build/test target and makes it the version the default configuration resolves to, following the existing convention where Otherwise mirrors the newest target.

  • Directory.Build.targets — new roslyn5.9 block referencing Microsoft.CodeAnalysis 5.9.0, defining ROSLYN5_9 and ROSLYN_5_9_OR_GREATER. Otherwise now tracks 5.9.0. C# 15 support (CSHARP15_OR_GREATER) is attributed to 5.9 rather than 5.6.
  • Meziantou.Analyzer.Pack.csproj — packs the analyzer and code fixer under analyzers/dotnet/roslyn5.9/cs/.
  • ci.yml — builds the 5.9 assemblies in create_nuget and adds roslyn5.9 to the build_and_test matrix.
  • ProjectBuilder — uses Microsoft.CodeAnalysis.CSharp.CodeStyle 5.9.0 when building against Roslyn 5.9 or later.
  • LanguageVersionExtensions.IsCSharp15OrAbove — drops the #if CSHARP15_OR_GREATER guard; the numeric comparison compiles and behaves correctly on every supported Roslyn version.
  • AGENTS.md — refreshes the supported-version list, which was stale (it still listed the removed 4.2/4.4/4.6 targets and claimed default was 5.0.0).

Notes for reviewers

  • Roslyn 5.9's maximum language version is still C# 15 — verified against the LanguageVersion enum in the shipped 5.9.0 package — so the CSHARP* constants stop at 15.
  • Since default now resolves to 5.9.0, the default CI leg duplicates the roslyn5.9 leg. That matches the prior state, where default duplicated roslyn5.6.

Testing

Full suite run locally against every target, all passing:

Target Tests Failed
roslyn4.8 3508 0
roslyn4.14 3542 0
roslyn5.0 3581 0
roslyn5.6 3592 0
roslyn5.9 3605 0

dotnet run --project src/DocumentationGenerator reports no markdown changes.

Roslyn 5.9.0 is the latest release, so add it as a build/test target and
make it the version the `default` configuration resolves to.

- `Directory.Build.targets`: new `roslyn5.9` block defining `ROSLYN5_9` and
  `ROSLYN_5_9_OR_GREATER`; `Otherwise` now tracks 5.9.0. C# 15 support is
  attributed to 5.9 rather than 5.6.
- `Meziantou.Analyzer.Pack.csproj`: pack the assemblies under
  `analyzers/dotnet/roslyn5.9/cs/`.
- `ci.yml`: build the 5.9 assemblies for the package and add `roslyn5.9`
  to the test matrix.
- `ProjectBuilder`: use `Microsoft.CodeAnalysis.CSharp.CodeStyle` 5.9.0 when
  building against Roslyn 5.9 or later.
- `LanguageVersionExtensions.IsCSharp15OrAbove`: drop the conditional
  compilation, the comparison works on every supported Roslyn version.
- `AGENTS.md`: refresh the supported-version list, which still mentioned the
  removed 4.2/4.4/4.6 targets.
@meziantou
meziantou merged commit b14079f into main Aug 17, 2026
12 checks passed
@meziantou
meziantou deleted the feature/roslyn-5-9-target-81c974 branch August 17, 2026 17:52
This was referenced Aug 17, 2026
This was referenced Aug 18, 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.

1 participant