Skip to content

fix: Replace msbuild with dotnet build in template CI scripts#1986

Open
Copilot wants to merge 5 commits intomainfrom
copilot/fix-ci-scripts-build-issue
Open

fix: Replace msbuild with dotnet build in template CI scripts#1986
Copilot wants to merge 5 commits intomainfrom
copilot/fix-ci-scripts-build-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 16, 2026

PR Type

  • Bugfix

What is the current behavior?

Template CI scripts (GitHub Actions and Azure DevOps) use msbuild directly, which fails to handle .NET workloads (wasm-tools, Android SDK). Builds fail with workload missing errors despite uno-check installing dependencies.

What is the new behavior?

CI scripts use dotnet build, which properly invokes workload resolution through the .NET SDK.

Changes:

  • GitHub Actions (GitHub/workflows/ci.yml):

    • Removed microsoft/setup-msbuild action
    • Changed msbuild *.csproj /rdotnet build *.csproj --configuration Debug/Release
  • Azure DevOps (AzurePipelines/jobs/*.yml):

    • Replaced MSBuild@1 task with PowerShell@2 running dotnet build
    • Explicit configuration flags for consistency

Example:

# Before
- task: MSBuild@1
  inputs:
    solution: ./MyApp.csproj
    msbuildArguments: '/r'

# After  
- task: PowerShell@2
  inputs:
    script: 'dotnet build ./MyApp.csproj --configuration Debug'

Flag syntax follows repository conventions: --configuration for config, -p: for MSBuild properties.

PR Checklist

  • Associated with an issue (GitHub or internal)

Other information

Template variables ($baseTargetFramework$, $DefaultBranchName$) preserved - replaced during template instantiation, not runtime.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug] Default template CI scripts fail to run</issue_title>
<issue_description>### Current behavior

The CI scripts that come with the templates (for GitHub Action and Azure DevOps) fail with messages that wasm-tools isn't installed or that the android workload isn't installed.

It seems that this is due to using msbuild instead of dotnet build/publish

Expected behavior

it should build

Affected platforms

iOS, Skia, WebAssembly, Android, Windows (WinAppSdk)

Template Host

dotnet new, Visual Studio

Host OS

macOS, Linux, Windows

Template Options

latest

Template Version

latest

Anything else we need to know?

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: kazo0 <4793020+kazo0@users.noreply.github.com>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI and others added 3 commits February 16, 2026 22:33
Co-authored-by: kazo0 <4793020+kazo0@users.noreply.github.com>
Co-authored-by: kazo0 <4793020+kazo0@users.noreply.github.com>
Co-authored-by: kazo0 <4793020+kazo0@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix default template CI scripts to ensure successful builds fix: Replace msbuild with dotnet build in template CI scripts Feb 16, 2026
Copilot AI requested a review from kazo0 February 16, 2026 22:36
@kazo0 kazo0 marked this pull request as ready for review February 17, 2026 13:11
Copilot AI review requested due to automatic review settings February 17, 2026 13:11
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 fixes a critical build failure in the default Uno Platform template CI scripts. The templates previously used msbuild directly, which fails to handle .NET workloads (wasm-tools, Android SDK) even when dependencies are installed via uno-check. The fix replaces all msbuild invocations with dotnet build, which properly invokes workload resolution through the .NET SDK.

Changes:

  • Removed microsoft/setup-msbuild action from GitHub Actions workflow
  • Replaced msbuild commands with dotnet build in GitHub Actions, using --configuration flag for build configuration
  • Replaced MSBuild@1 tasks with PowerShell@2 tasks running dotnet build in Azure DevOps pipelines
  • Maintained consistent MSBuild property syntax using -p: prefix for all custom properties

Reviewed changes

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

File Description
src/Uno.Templates/content/unoapp/GitHub/workflows/ci.yml Removed setup-msbuild action and replaced msbuild commands with dotnet build for both smoke test and unit test jobs
src/Uno.Templates/content/unoapp/AzurePipelines/jobs/unit-test.yml Replaced MSBuild@1 task with PowerShell@2 task running dotnet build with proper error handling
src/Uno.Templates/content/unoapp/AzurePipelines/jobs/smoke-test.yml Replaced MSBuild@1 task with PowerShell@2 task running dotnet build with proper error handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

[Bug] Default template CI scripts fail to run

4 participants