microsoft / microsoft/win-dev-skills

winui-dev-workflow + analyzer: set <RuntimeIdentifiers> for multi-arch packaging by default

Open
#101 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
442
Forks
33
Avg merge
2h 59m
Merged PRs (30d)
11

Description

97: #97

Problem

From Joe's blog post:

When I selected to package for x64 and Arm64 I got an error stemming from the runtime identifiers not being set, a quick fix.

The winui-mvvm template scaffolds a project without a <RuntimeIdentifiers> property. winapp package for both x64 and Arm64 then fails with an error that's clear once you know it, opaque if you don't. Joe figured it out manually; the agent didn't anticipate it.

Proposed fix

Two-part:

  1. Scaffold fix (winui-dev-workflow) — after dotnet new winui-mvvm, ensure the .csproj contains:

    <PropertyGroup>
      <RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
    </PropertyGroup>
    

    via a small post-scaffold merge step in the skill (or, ideally, a PR upstream to the WinUI template itself so this disappears).

  2. Analyzer rule (Microsoft.WindowsAppSDK.Analyzers) — new rule (proposed ID WAPK00XX, Warning severity, with helpLinkUri):

    Package.appxmanifest declares Arm64 (or any architecture not present in <RuntimeIdentifiers>) — winapp package will fail. Add win-arm64 to <RuntimeIdentifiers> in the .csproj.

    This catches the existing-project case the scaffold fix doesn't cover.

Related

May be subsumed by — or coordinated with — a unified "greenfield polish phase" step (see cross-cutting themes on the 97 issue).

Acceptance criteria

  • New scaffold passes winapp package for both x64 and arm64 with zero edits.
  • Analyzer rule fires on a mismatched existing project; analyzer test added.
  • Rule documented in src/tools/winui-analyzer/README.md with its rule-table entry.

Acknowledgments

Identified by Joe Finney in Building Fluent Icon Finder with the WinUI Copilot skill.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the winui-dev-workflow post-scaffold step and the analyzer documentation at src/tools/winui-analyzer/README.md. Identify the analyzer's test location and existing rule-table format, then verify that a new scaffold packages for x64 and arm64, the mismatch rule fires, its test passes, and the rule is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.