Skip to content

Conversation

@paulmedynski
Copy link
Contributor

@paulmedynski paulmedynski commented Nov 21, 2025

Description

  • Added global.json to restrict our SDK to the single supported version, currently 10.0.
  • Using global.json to install .NET SDKs everywhere except when we may need ARM64.
  • Removed unnecessary installation of .NET runtimes where they aren't needed.

Testing

PR, CI, and Official pipelines will validate.

Copilot AI review requested due to automatic review settings November 21, 2025 15:22
Copy link
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 introduces global.json to standardize the .NET SDK version (9.0.0) across the project and migrates pipeline files to use UseDotNet@2 with useGlobalJson: true instead of hardcoded version numbers or the ensure-dotnet-version.yml template. The changes simplify SDK installation, remove unnecessary runtime installations in build-only scenarios, and reduce redundant .NET Framework test targets in the stress tests.

Key changes:

  • Added global.json specifying .NET 9.0 SDK with rollForward: "feature" policy
  • Updated 6 pipeline files to use UseDotNet@2 with useGlobalJson: true
  • Removed installation of .NET 8.x runtime in build-only scenarios where tests aren't run
  • Reduced stress test .NET Framework targets from 6 versions to just net462

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
global.json New file specifying .NET 9.0.0 SDK requirement with feature rollforward and no prerelease versions
eng/pipelines/steps/compound-build-akv-step.yml Migrated from hardcoded SDK/runtime installation to global.json; removed unnecessary .NET 8.x runtime
eng/pipelines/stages/stress-tests-ci-stage.yml Reduced .NET Framework test targets from 6 versions to just net462
eng/pipelines/jobs/stress-tests-ci-job.yml Updated to use global.json for SDK installation and changed .NET 8 runtime from '8.x' to '8.0'
eng/pipelines/dotnet-sqlclient-ci-core.yml Added net9.0 to x86 test target frameworks with explanatory comments
eng/pipelines/common/templates/steps/build-all-configurations-signed-dlls-step.yml Migrated to global.json; removed unnecessary .NET 8.x runtime installation
eng/pipelines/common/templates/jobs/ci-run-tests-job.yml Simplified x86 SDK/runtime installation using global.json and added .NET 8.0 runtime for tests
eng/pipelines/common/templates/jobs/ci-code-coverage-job.yml Replaced ensure-dotnet-version template with UseDotNet@2 using global.json

Copy link
Contributor Author

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commentary for reviewers.

parameters:
packageType: 'sdk'
version: '10.0'
# Install whichever .NET SDKs are specified in our global.json.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code coverage only runs on Windows x64, so we don't need the special ensure-dotnet.version template here.

packageType: sdk
version: '9.x'

- task: UseDotNet@2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need a .NET 8 runtime to build things. We would only need it to run tests, which doesn't happen as part of this pipeline tree.

packageType: 'sdk'
version: '9.x'

- task: UseDotNet@2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need a .NET 8 runtime to build things. We would only need it to run tests, which doesn't happen as part of this pipeline tree.

Copilot AI review requested due to automatic review settings November 21, 2025 17:44
Copy link
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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

eng/pipelines/jobs/stress-tests-ci-job.yml:146

  • With the stress tests now targeting net9.0 (as specified in netTestRuntimes parameter which defaults to [net8.0, net9.0]), the .NET 9.0 runtime should also be installed. Consider adding:
# Install the .NET 9.0 runtime to run tests that target it.
- task: UseDotNet@2
  displayName: Install .NET 9.0 Runtime
  inputs:
    packageType: runtime
    version: 9.x
  # Install the .NET 8.0 runtime to run tests that target it.
  - task: UseDotNet@2
    displayName: Install .NET 8.0 Runtime
    inputs:
      packageType: runtime
      version: 8.x

Copy link
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

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Copilot AI review requested due to automatic review settings November 24, 2025 13:59
Copy link
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

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Copilot AI review requested due to automatic review settings November 24, 2025 16:17
Copy link
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

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings November 25, 2025 11:51
Copy link
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 16 comments.


You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Copilot AI review requested due to automatic review settings November 25, 2025 14:23
Copy link
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.


You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Copy link
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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.


You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Copilot AI review requested due to automatic review settings November 27, 2025 17:48
Copy link
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

Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

eng/pipelines/jobs/stress-tests-ci-job.yml:145

  • The stress test job installs the .NET 8.0 runtime but not the .NET 9.0 runtime. Since the stress tests target net9.0 (as seen in stress-tests-ci-stage.yml line 57 which defaults to [net8.0, net9.0]), the .NET 9.0 runtime should also be installed.

Add a step after line 144 to install the .NET 9.0 runtime:

- task: UseDotNet@2
  displayName: Install .NET 9.0 Runtime
  inputs:
    packageType: runtime
    version: 9.x
  - task: UseDotNet@2
    displayName: Install .NET 8.0 Runtime
    inputs:
      packageType: runtime

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

…on, currently 9.0.

- Using global.json to install .NET SDKs everywhere except when we may need ARM64.
- Removed unnecessary installation of .NET SDKs and runtimes where they aren't needed.
- Added all target frameworks to the x86 test runs.
- Updated documentation related to SDKs.
- Removed runtime ARM64 architecture detection in favour of explicit parameters for the test jobs that use ARM64.
- Suppressing CredScan errors related to test secrets.
Copilot AI review requested due to automatic review settings December 4, 2025 19:22
Copy link
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

Copilot reviewed 21 out of 21 changed files in this pull request and generated 5 comments.

- Updated install-dotnet template to handle all cases of .NET SDK and Runtime installation for the pipelines.
Copilot AI review requested due to automatic review settings December 5, 2025 20:38
Copy link
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

Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.

..\eng\pipelines\steps\compound-publish-symbols-step.yml = ..\eng\pipelines\steps\compound-publish-symbols-step.yml
..\eng\pipelines\steps\roslyn-analyzers-akv-step.yml = ..\eng\pipelines\steps\roslyn-analyzers-akv-step.yml
..\eng\pipelines\steps\script-output-environment-variables-step.yml = ..\eng\pipelines\steps\script-output-environment-variables-step.yml
..\eng\pipelines\steps\install-dotnet-arm64.yml = ..\eng\pipelines\steps\install-dotnet-arm64.yml
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file reference is to install-dotnet-arm64.yml, but the actual file created in this PR is install-dotnet-arm64.ps1 (a PowerShell script, not a YAML file). This appears to be incorrect. Either the solution file should reference install-dotnet-arm64.ps1, or if you intended to reference the YAML template, it should be install-dotnet.yml.

Suggested change
..\eng\pipelines\steps\install-dotnet-arm64.yml = ..\eng\pipelines\steps\install-dotnet-arm64.yml
..\eng\pipelines\steps\install-dotnet-arm64.ps1 = ..\eng\pipelines\steps\install-dotnet-arm64.ps1

Copilot uses AI. Check for mistakes.
- task: PowerShell@2
displayName: Install .NET SDK and Runtimes for ARM64
pwsh: true
filePath: install-dotnet-arm64.ps1
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filePath parameter for PowerShell@2 task should include a full or relative path. The current value install-dotnet-arm64.ps1 assumes the script is in the working directory. Consider using a path relative to the repo root like $(Build.SourcesDirectory)/eng/pipelines/steps/install-dotnet-arm64.ps1 or ./eng/pipelines/steps/install-dotnet-arm64.ps1 to ensure the script can be found reliably.

Suggested change
filePath: install-dotnet-arm64.ps1
filePath: $(Build.SourcesDirectory)/eng/pipelines/steps/install-dotnet-arm64.ps1

Copilot uses AI. Check for mistakes.
Write-Host ($installParams | ConvertTo-Json -Depth 1)
}

& ./dotnet-install.ps1 -Verbose:$Debug -DryRun:$DryRun @installParams
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script invokes ./dotnet-install.ps1 with a relative path, which assumes the current working directory contains the script. However, based on line 70-77, the script is downloaded to $InstallDir/dotnet-install.ps1. The invocation should use & "$InstallDir/dotnet-install.ps1" instead to ensure the correct script is executed.

Copilot uses AI. Check for mistakes.
Write-Host ($installParams | ConvertTo-Json -Depth 1)
}

& ./dotnet-install.ps1 -Verbose:$Debug -DryRun:$DryRun @installParams
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as line 118: the script invokes ./dotnet-install.ps1 with a relative path. This should be & "$InstallDir/dotnet-install.ps1" to ensure the correct script location is used.

Suggested change
& ./dotnet-install.ps1 -Verbose:$Debug -DryRun:$DryRun @installParams
& "$InstallDir/dotnet-install.ps1" -Verbose:$Debug -DryRun:$DryRun @installParams

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commentary for reviewers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a separate PowerShell file for this work has several benefits:

  • Easy to test locally.
  • IDE syntax highlighting and intellisense.
  • Easier to review.

an empty array.
.NOTES
Licensed to the .NET Foundation under one or more agreements.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first line in the file needs to be the comment-based help <# #>, so the license needs to go somewhere else. This was Gemini's suggestion.

Copilot AI review requested due to automatic review settings December 8, 2025 14:32
Copy link
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

Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.

# Install the .NET SDK and Runtimes.
- template: /eng/pipelines/steps/install-dotnet.yml@self
parameters:
runtimes: ['8.0', '9.0']
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent runtime version format. Other pipeline files use ['8.x', '9.x'] format (e.g., ci-run-tests-job.yml:117, stress-tests-ci-job.yml:137), but this uses ['8.0', '9.0']. For the UseDotNet@2 task, the .x suffix is standard and allows automatic selection of the latest patch version. Consider changing to ['8.x', '9.x'] for consistency and to match the documented format for UseDotNet@2.

Suggested change
runtimes: ['8.0', '9.0']
runtimes: ['8.x', '9.x']

Copilot uses AI. Check for mistakes.
}

#------------------------------------------------------------------------------
# Download the dotnet-install.ps1 script it if isn't already present.
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "script it if" should be "script if".

Suggested change
# Download the dotnet-install.ps1 script it if isn't already present.
# Download the dotnet-install.ps1 script if it isn't already present.

Copilot uses AI. Check for mistakes.
pool: ADO-CI-PUBLIC-ARM64-1ES-EUS-POOL
images:
Win11_ARM64_Azure_Sql: ADO-WIN11-ARM64
isArm64: true,
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid YAML syntax: There is a trailing comma after true which is not valid in YAML. The comma should be removed. This should be isArm64: true without the comma.

Suggested change
isArm64: true,
isArm64: true

Copilot uses AI. Check for mistakes.
- task: PowerShell@2
displayName: Install .NET SDK and Runtimes for ARM64
pwsh: true
filePath: install-dotnet-arm64.ps1
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filePath should specify a full or relative path to the PowerShell script. Currently it only specifies the filename install-dotnet-arm64.ps1, which may not be found unless it's in the working directory. Consider using a path like $(Build.SourcesDirectory)/eng/pipelines/steps/install-dotnet-arm64.ps1 or use workingDirectory parameter to set the correct directory.

Suggested change
filePath: install-dotnet-arm64.ps1
filePath: $(Build.SourcesDirectory)/eng/pipelines/steps/install-dotnet-arm64.ps1

Copilot uses AI. Check for mistakes.
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.

4 participants