Skip to content

Use dotnet CLI exclusively (no MSBuild)#4168

Draft
paulmedynski wants to merge 1 commit intomainfrom
dev/paul/remove-msbuild
Draft

Use dotnet CLI exclusively (no MSBuild)#4168
paulmedynski wants to merge 1 commit 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
- 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.
@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.

projects: build.proj
arguments: >-
-t:PackAkvProvider
-p:Platform=${{ parameters.platform }}
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.

Platform is only preserved for build.proj. build2.proj doesn't use Platform even though it was being specified.

inputs:
solution: build2.proj
msbuildArchitecture: x64
platform: '${{ parameters.platform }}'
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.

Here we see Platform being removed, since build2.proj doesn't use it.

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 66.56%. Comparing base (52c7149) to head (98cb968).
⚠️ Report is 3 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (52c7149) and HEAD (98cb968). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (52c7149) HEAD (98cb968)
CI-SqlClient 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4168      +/-   ##
==========================================
- Coverage   74.27%   66.56%   -7.71%     
==========================================
  Files         279      274       -5     
  Lines       42980    65799   +22819     
==========================================
+ Hits        31922    43801   +11879     
- Misses      11058    21998   +10940     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 66.56% <ø> (?)

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.

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: Investigating

Development

Successfully merging this pull request may close these issues.

3 participants