Update LangVersion to preview#26214
Merged
adityapatwardhan merged 2 commits intoPowerShell:masterfrom Feb 19, 2026
Merged
Conversation
Contributor
Author
|
@TravisEz13 @jshigetomi please could you review |
12 tasks
Contributor
Author
|
@adityapatwardhan @TravisEz13 do you want to bump to |
0979f73 to
cb59e3b
Compare
Contributor
Author
|
@adityapatwardhan bumped to |
adityapatwardhan
requested changes
Feb 19, 2026
cb59e3b to
600c277
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the C# language version from 13.0 to preview across the PowerShell repository. This enables the use of C# preview language features in the codebase. The change is applied to common property files that are imported by most projects, as well as specific projects that explicitly set their own LangVersion.
Changes:
- Updated LangVersion from
13.0topreviewin PowerShell.Common.props, Test.Common.props, and several individual project files - Renamed variable from
fieldtomatchin BasicHtmlWebResponseObject.Common.cs to avoid conflict with C# 13'sfieldcontextual keyword
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| PowerShell.Common.props | Updates main LangVersion setting that most source projects inherit |
| test/Test.Common.props | Updates test projects' LangVersion setting |
| src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj | Updates LangVersion for source generator project |
| test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj | Updates LangVersion for test tool |
| test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj | Updates LangVersion for performance comparison tool |
| tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj | Updates LangVersion for reference assembly packaging |
| tools/packaging/projects/reference/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj | Updates LangVersion for reference assembly packaging |
| tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj | Updates LangVersion for reference assembly packaging |
| src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/BasicHtmlWebResponseObject.Common.cs | Renames variable from field to match to avoid conflict with C# 13 contextual keyword |
adityapatwardhan
approved these changes
Feb 19, 2026
Member
|
@xtqqczze Thank you for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update the C#
LangVersionsetting across the repository topreview.Supercedes #25768.