Use global.json to restrict .NET SDK use#3797
Conversation
There was a problem hiding this comment.
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.jsonspecifying .NET 9.0 SDK withrollForward: "feature"policy - Updated 6 pipeline files to use
UseDotNet@2withuseGlobalJson: 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 |
paulmedynski
left a comment
There was a problem hiding this comment.
Commentary for reviewers.
eng/pipelines/common/templates/steps/build-all-configurations-signed-dlls-step.yml
Show resolved
Hide resolved
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
897a15a to
d5ce1f0
Compare
d5ce1f0 to
928257c
Compare
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
…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. - Created separate PowerShell script to install .NET for ARM64. - Updated install-dotnet template to handle all cases of .NET SDK and Runtime installation for the pipelines. - Updataed to .NET SDK 10.0.101.
7dfc87a to
bffb4dc
Compare
Description
Testing
PR, CI, and Official pipelines will validate.