Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 15, 2025

Problem

GitHub Actions builds were failing with the error:

CSC : error CS1617: Invalid option '11' for /langversion. Use '/langversion:?' to list supported values.

Root Cause

The project specifies <LangVersion>11</LangVersion> (C# 11) in the .csproj file, but the GitHub Actions workflows were configured to use .NET 6.0.x, which only supports up to C# 10. C# 11 language features were introduced with .NET 7.0.

Solution

Updated both GitHub Actions workflows to use .NET 7.0.x instead of .NET 6.0.x:

  • .github/workflows/dotnet.yml
  • .github/workflows/release.yml

Technical Details

The codebase legitimately uses C# 11 features, specifically the scoped keyword for performance optimization with ref structs:

private void FormatInternal(scoped ref CharBuffer buffer, int value)
private void Format(scoped ref CharBuffer buffer, long value, bool fillMil = false)

Rather than downgrading the language features and losing performance benefits, updating the CI environment to support C# 11 is the appropriate solution.

Compatibility

This change maintains full backward compatibility:

  • The compiled library still targets net6.0;netstandard2.0;netstandard2.1 runtimes
  • Only the build-time environment was updated to support C# 11 compilation
  • No functional code changes were required

Fixes #16.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: tiakun <1862558+tiakun@users.noreply.github.com>
Copilot AI changed the title [WIP] Build Action Error Fix GitHub Actions build error: Update .NET version to support C# 11 Jul 15, 2025
Copilot AI requested a review from tiakun July 15, 2025 06:15
@tiakun tiakun closed this Sep 27, 2025
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.

Build Action Error

2 participants