Skip to content

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

@nmetulev

Description

@nmetulev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions