Skip to content

Use dotnet CLI exclusively (no MSBuild)#4168

Open
paulmedynski wants to merge 5 commits intomainfrom
dev/paul/remove-msbuild
Open

Use dotnet CLI exclusively (no MSBuild)#4168
paulmedynski wants to merge 5 commits intomainfrom
dev/paul/remove-msbuild

Conversation

@paulmedynski
Copy link
Copy Markdown
Contributor

Description

  • Removed use of MSBuild in pipelines and documentation.
  • Legacy build.proj still uses it, and will be replaced shortly by build2.proj which uses the dotnet CLI exclusively.

Testing

  • Automatic PR/CI runs will confirm changes to those pipelines.
  • Manual runs of OneBranch pipelines will confirm changes there.

@paulmedynski paulmedynski added this to the 7.1.0-preview1 milestone Apr 8, 2026
Copilot AI review requested due to automatic review settings April 8, 2026 19:09
@paulmedynski paulmedynski added the Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems. label Apr 8, 2026
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Apr 8, 2026
@paulmedynski paulmedynski force-pushed the dev/paul/remove-msbuild branch from 0721576 to 98cb968 Compare April 8, 2026 19:12
Copy link
Copy Markdown
Contributor

@benrr101 benrr101 left a comment

Choose a reason for hiding this comment

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

In general I think this will be good - but let me know what your proposed timeline for getting this through is so I can get prepared for merge conflicts in my build2.proj work :)

@paulmedynski
Copy link
Copy Markdown
Contributor Author

@benrr101 - This PR will wait for your work to complete. I will deal with any conflicts here.

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 repo’s build/test orchestration to use the dotnet CLI end-to-end (instead of invoking MSBuild directly), aligning OneBranch + CI templates and developer documentation with the upcoming build2.proj workflow.

Changes:

  • Updated OneBranch pipeline steps to invoke dotnet build / DotNetCoreCLI@2 for .proj-driven builds, packing, and Roslyn analyzer runs.
  • Updated CI templates to use DotNetCoreCLI@2 for .proj targets and removed the msbuild agent demand where it’s no longer needed.
  • Updated BUILDGUIDE and internal docs/instructions to recommend dotnet build build.proj ... and removed MSBuild-specific wording.

Reviewed changes

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

Show a summary per file
File Description
eng/pipelines/onebranch/steps/roslyn-analyzers-sqlclient-step.yml Switch Roslyn analyzer build command to dotnet build for build2.proj.
eng/pipelines/onebranch/steps/roslyn-analyzers-csproj-step.yml Switch Roslyn analyzer build command to dotnet build for build.proj.
eng/pipelines/onebranch/steps/pack-sqlclient-step.yml Replace MSBuild task with DotNetCoreCLI@2 build for PackMds.
eng/pipelines/onebranch/steps/pack-csproj-step.yml Replace MSBuild task with DotNetCoreCLI@2 build for pack targets.
eng/pipelines/onebranch/steps/build-sqlclient-step.yml Replace MSBuild task with DotNetCoreCLI@2 build for BuildMds.
eng/pipelines/onebranch/steps/build-csproj-step.yml Replace MSBuild task with DotNetCoreCLI@2 build for csproj build targets.
eng/pipelines/common/templates/steps/run-all-tests-step.yml Convert Windows test orchestration from MSBuild task usage to DotNetCoreCLI@2 build.
eng/pipelines/common/templates/steps/ci-project-build-step.yml Convert project build steps to DotNetCoreCLI@2 build with equivalent properties.
eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml Remove msbuild demand and use DotNetCoreCLI@2 for packing AKV provider.
doc/apps/AzureAuthentication/README.md Remove MSBuild-specific wording for build properties.
BUILDGUIDE.md Update guidance/examples to use dotnet build build.proj ... and adjust prerequisites text.
.github/plans/apicompat-ref-assembly-validation.md Update example commands from dotnet msbuild to dotnet build.
.github/instructions/testing.instructions.md Update testing instructions to use dotnet build build.proj ... and generalize IDE guidance.
.github/instructions/architecture.instructions.md Replace “MSBuild property” wording with “build property”.
.github/instructions/ado-pipelines.instructions.md Rename dotnetVerbosity description away from MSBuild-specific wording.
.github/copilot-instructions.md Update repo build description to reflect dotnet build usage.

Comment thread eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml Outdated
Comment thread eng/pipelines/common/templates/steps/ci-project-build-step.yml
displayName: 'Create AKV Provider NuGet Package'
inputs:
solution: build.proj
msbuildArchitecture: x64
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

msBuildArchitecture is irrelevant and has been removed everywhere.

@@ -154,17 +154,16 @@ steps:
-p:DotnetPath=${{ parameters.dotnetx86RootPath }}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The DotnetPath decides which dotnet runtime architecture to use. msBuildArchitecture above wasn't useful here anyway.

@paulmedynski paulmedynski moved this from To triage to Investigating in SqlClient Board Apr 8, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.31%. Comparing base (771b16c) to head (438d1ab).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4168      +/-   ##
==========================================
- Coverage   65.95%   64.31%   -1.65%     
==========================================
  Files         277      272       -5     
  Lines       42989    65783   +22794     
==========================================
+ Hits        28354    42309   +13955     
- Misses      14635    23474    +8839     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 64.31% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

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

Comments suppressed due to low confidence (1)

build.proj:559

  • GetSqlClientPackageVersionCommand switched from dotnet msbuild to dotnet build, but the command still uses MSBuild-only switches (-nologo, -verbosity:quiet, -getProperty:...). dotnet build doesn't reliably accept/forward these unless passed after --, and -getProperty in particular is intended for dotnet msbuild. This will likely break PackSqlClient when it tries to evaluate SqlClientPackageVersion.

Consider reverting this one command to dotnet msbuild, or use dotnet build ... -- -getProperty:SqlClientPackageVersion -nologo -verbosity:quiet so the switches are forwarded to MSBuild correctly.

      <GetSqlClientPackageVersionCommand>
        "$(DotnetPath)dotnet" build "$(SqlClientProjectPath)"
        -nologo
        -verbosity:quiet
        -getProperty:SqlClientPackageVersion

Comment thread BUILDGUIDE.md
Comment thread .github/plans/apicompat-ref-assembly-validation.md
Comment thread .github/instructions/testing.instructions.md Outdated
@paulmedynski paulmedynski moved this from Investigating to In progress in SqlClient Board Apr 27, 2026
- Removed use of MSBuild in pipelines and documentation.
- Legacy build.proj still uses it, and will be replaced shortly by build2.proj which uses the dotnet CLI exclusively.
- Rebased to the latest build.proj and updated everything to use dotnet CLI.
- Converted the CI AKV build/pack steps to use build.proj targets.
-p:PackageVersionSqlClient=${{ parameters.mdsPackageVersion }}
-p:PackageVersionAkvProvider=${{ parameters.akvPackageVersion }}

- task: CopyFiles@2
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The PackAkvProvider target doesn't put the NuGet files in the $(packagePath), so we copy them there. This is a stop-gap measure until the new CI pipelines build/pack all of the products the same way.

- name: buildArguments
value: >-
--configuration ${{ parameters.buildConfiguration }}
-p:Configuration=${{ parameters.buildConfiguration }}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Specifying the build configuration now consistently uses -p: syntax.

Comment thread BUILDGUIDE.md
Comment thread .github/plans/apicompat-ref-assembly-validation.md
Comment thread .github/instructions/testing.instructions.md Outdated
Copilot AI review requested due to automatic review settings April 28, 2026 10:15
@paulmedynski paulmedynski force-pushed the dev/paul/remove-msbuild branch from 14486bf to d276965 Compare April 28, 2026 10:15
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

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

Comment thread eng/pipelines/stress/stress-tests-job.yml
Comment thread .github/instructions/testing.instructions.md Outdated
@paulmedynski paulmedynski marked this pull request as ready for review April 28, 2026 13:32
@paulmedynski paulmedynski requested a review from a team as a code owner April 28, 2026 13:32
@paulmedynski paulmedynski moved this from In progress to In review in SqlClient Board Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems.

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

5 participants