-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Updates for C# 14 reaching GA #49940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
LangVersion of preview shouldn't be needed anywhere now
C# 14 is G.A. The `field` keyword is no longer a preview feature. Make those updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates documentation and code snippets to reflect that C# 14 has reached General Availability (GA). The changes remove preview-related language and configuration, and update version references for the field keyword feature from C# 13 to C# 14.
Key changes include:
- Removing
<LangVersion>preview</LangVersion>from all .csproj files across the documentation - Updating target frameworks from net8.0/net9.0 to net10.0 where appropriate
- Updating references to Visual Studio from 2022 to 2026
- Removing the field-preview.md include file and all references to it
- Updating documentation to state that the
fieldkeyword was added in C# 14 (not C# 13 preview)
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| orleansurlshortener.csproj | Removed LangVersion preview and updated to net10.0 |
| CompoundAssignment.csproj | Removed LangVersion preview |
| csharp-14.md | Updated date, VS version to 2026, removed preview language, commented out feature tracking text |
| csharp-13.md | Updated field keyword documentation to reference C# 14 and replaced include with inline warning |
| methods.csproj | Removed LangVersion preview and updated to net10.0 |
| using-properties.md | Updated field keyword reference from C# 13 to C# 14, removed include |
| properties.csproj | Removed LangVersion preview and updated to net10.0 |
| PartialClassesAndMethods.csproj | Removed LangVersion preview and updated to net10.0 |
| ExtensionMembers.csproj | Removed LangVersion preview |
| properties.md | Updated field keyword reference from C# 13 to C# 14, removed include |
| partial-classes-and-methods.md | Removed field-preview include |
| auto-implemented-properties.md | Updated field keyword reference from C# 13 to C# 14, removed include |
| HowToExtend.csproj | Removed LangVersion preview |
| lock.csproj | Removed LangVersion preview and updated to net10.0 |
| operators.csproj | Removed LangVersion preview |
| lambda-expressions.csproj | Removed LangVersion preview and updated to net10.0 |
| keywords.csproj | Removed LangVersion preview |
| set.md | Updated field keyword reference from C# 13 to C# 14, removed include |
| init.md | Updated field keyword reference from C# 13 to C# 14, removed include |
| get.md | Updated field keyword reference from C# 13 to C# 14, removed include |
| field.md | Updated field keyword reference from C# 13 to C# 14, removed include |
| errors-warnings.md | Removed "preview" row label from table |
| partial-declarations.md | Updated field keyword reference from C# 13 to C# 14, removed include |
| field-preview.md | Deleted include file |
| Project.csproj (dotnet-9) | Removed LangVersion preview |
| snippets.csproj (dotnet-10) | Removed LangVersion preview |
docs/csharp/language-reference/compiler-options/errors-warnings.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
meaghanlewis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes LGTM.
Fixes #49877: .NET 10 requires Visual Studio2026
Fixes #49709:
<LangVersion>preview</LangVersion>from all csproj files.Fixes #48945
fieldas a preview feature in C# 13.fieldto refer to C# 14, rather than C# 13 as a "preview" feature.Note to reviewers: There are a large number of files, but the changes are largely similar phrase changes. The review won't be as difficult as the scale looks.
Internal previews
Toggle expand/collapse
partialtype andpartialmember declarationsfieldcontextual keyword"getkeywordinitkeyword (C# Reference)setkeyword: property accessor"