Skip to content

Update LangVersion to preview#26214

Merged
adityapatwardhan merged 2 commits intoPowerShell:masterfrom
xtqqczze:LangVersion
Feb 19, 2026
Merged

Update LangVersion to preview#26214
adityapatwardhan merged 2 commits intoPowerShell:masterfrom
xtqqczze:LangVersion

Conversation

@xtqqczze
Copy link
Copy Markdown
Contributor

@xtqqczze xtqqczze commented Oct 16, 2025

Update the C# LangVersion setting across the repository to preview.

Supercedes #25768.

@xtqqczze xtqqczze requested review from a team and jshigetomi as code owners October 16, 2025 11:00
@iSazonov iSazonov added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Oct 18, 2025
@xtqqczze
Copy link
Copy Markdown
Contributor Author

@TravisEz13 @jshigetomi please could you review

@xtqqczze
Copy link
Copy Markdown
Contributor Author

@adityapatwardhan @TravisEz13 do you want to bump to preview (C# 15) after #26783 is merged?

@xtqqczze xtqqczze changed the title Update LangVersion to 14.0 Update LangVersion to preview Feb 19, 2026
@xtqqczze
Copy link
Copy Markdown
Contributor Author

@adityapatwardhan bumped to preview

Comment thread PowerShell.Common.props Outdated
@microsoft-github-policy-service microsoft-github-policy-service Bot added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Review - Needed The PR is being reviewed labels Feb 19, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Feb 19, 2026
@iSazonov iSazonov requested a review from Copilot February 19, 2026 09:46
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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.0 to preview in PowerShell.Common.props, Test.Common.props, and several individual project files
  • Renamed variable from field to match in BasicHtmlWebResponseObject.Common.cs to avoid conflict with C# 13's field contextual 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 adityapatwardhan merged commit 2af5ad1 into PowerShell:master Feb 19, 2026
46 checks passed
@adityapatwardhan
Copy link
Copy Markdown
Member

@xtqqczze Thank you for your contribution!

@xtqqczze xtqqczze deleted the LangVersion branch February 19, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants