Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 16, 2025

Fixes the incorrect information in docs/wiki/Troubleshooting-tips.md about the #error version feature.

Issue

The documentation stated that #error version "only works with C# 7.1 or later", which was misleading because it's a compiler feature, not a language version requirement.

Changes

Updated the note from:

(Note this only works with C# 7.1 or later)

To:

(Note this only works with compiler version 2.3 or later, which shipped with Visual Studio 2017 version 15.3)

Rationale

The #error version feature:

  • Works with any language version setting (including C# 4, as confirmed by TestErrorWithVersion in the test suite)
  • Requires compiler version 2.3+ (Microsoft.CodeAnalysis 2.3, which shipped with VS 2017 v15.3)
  • Was introduced alongside C# 7.1 support, which likely caused the original confusion

The compiler version 2.3 happens to be the first version that supported C# 7.1 as a language version, but the feature itself doesn't depend on the language version being set to 7.1 - it works regardless of what language version you're targeting.

Fixes #76835

Original prompt

This section details on the original issue you should resolve

<issue_title>Probably incorrect information in a markdown file</issue_title>
<issue_description>https://github.com/dotnet/roslyn/blob/92f024ab986153902d5aa15a2d079ccd28dd673d/docs/wiki/Troubleshooting-tips.md#verifying-the-version-of-the-compiler-and-language

For environments where you cannot use the command-line, you can include #error version in your program and the compiler and language versions will be printed as an error message. (Note this only works with C# 7.1 or later)

I think this depends on the compiler version, not the language version. Maybe it's meant the compiler shipped with C# 7.1 or later?</issue_description>

Comments on the Issue (you are @copilot in this section)

@RikkiGibson Yeah, this probably implies Microsoft.CodeAnalysis 2.3 or 2.4, going by [this doc](https://github.com/dotnet/roslyn/blob/bf26b0607760eabf50ee20e60513b7492decea96/docs/wiki/NuGet-packages.md#versioning)

Fixes #47084


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

Copilot AI changed the title [WIP] Fix incorrect information in troubleshooting markdown file Fix documentation: clarify #error version requires compiler version, not language version Oct 16, 2025
Copilot AI requested a review from CyrusNajmabadi October 16, 2025 22:40
@CyrusNajmabadi
Copy link
Member

@RikkiGibson does this look correct?

@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review November 6, 2025 19:31
@CyrusNajmabadi CyrusNajmabadi merged commit 1607d1e into main Nov 6, 2025
4 of 5 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the copilot/fix-markdown-information branch November 6, 2025 20:04
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Nov 6, 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.

Probably incorrect information in a markdown file

3 participants