Skip to content

CI pipelines should use repo build scripts instead of UseDotNet@2 #706

Description

@MichaelSimons

Problem

Both the PR and official CI pipelines use the UseDotNet@2 Azure DevOps task with version: 8.x to install the .NET SDK, bypassing the repo's own build infrastructure (eng/common/build.sh, eng/common/CIBuild.cmd).

This causes several issues:

  1. SDK version drift — The pipelines install whatever the latest 8.0.x SDK is (currently 8.0.420), which may differ from the version specified in global.json (8.0.126). When upgrading the SDK, you have to update both global.json and the pipeline YAML, rather than just one place.

  2. Inconsistency with local development — Developers building locally use the build scripts which honor global.json, while CI uses a potentially different SDK version. This can mask or introduce issues that don't reproduce in the other environment.

  3. Maintenance burden — The UseDotNet@2 version must be manually kept in sync across 6 pipeline locations (3 jobs × 2 pipeline files). The build scripts already handle SDK acquisition correctly from a single source of truth.

Suggestion

Replace the UseDotNet@2 task and separate DotNetCoreCLI@2 test task with a single call to the repo's build scripts (eng/common/build.sh / eng/common/CIBuild.cmd). The build scripts handle SDK installation automatically (honoring global.json) and then build/test — consolidating two pipeline steps into one and eliminating the version drift problem.

Activity

  1. added a commit that references this issue on Apr 29, 2026
    2257343
  2. Frulfump commented on Apr 29, 2026

    @Frulfump

    Why didn't the UseDotNet@2 task use the useGlobalJson parameter set to true? (There's been some updates to the task recently so it should work better)

    But it makes sense you would dog food your own script directly without a wrapper.

  3. MichaelSimons commented on Apr 29, 2026

    @MichaelSimons
    MemberAuthor

    Why didn't the UseDotNet@2 task use the useGlobalJson parameter set to true? (There's been some updates to the task recently so it should work better)

    That's a fair option. I prefer using the arcade build scripts that are standard across the dotnet repos. Currently they are checked in but don't work which leads to a frustrating dev UX for those who are accustom to using them.

  4. added
    area-infrainstall-scripts infrastructure and reporting
    and removed
    untriagedIssue is awaiting triage
    on Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-infrainstall-scripts infrastructure and reporting

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions