Skip to content

Uno.Sdk: setting WindowsSdkPackageVersion fails with NETSDK1230 since the default WindowsSdkPackageMinimumRevision was added #26174

Closed

Description

@MartinZikmund

Current behavior 🐛

Since #25836, a project using Uno.Sdk that sets WindowsSdkPackageVersion (in the csproj or as an environment variable) no longer builds for the Windows target:

error NETSDK1230: The WindowsSdkPackageVersion and WindowsSdkPackageMinimumRevision properties cannot both be specified. Remove one or the other.

#25836 added this to Uno.Common.WinAppSdk.targets:

<WindowsSdkPackageMinimumRevision Condition=" '$(WindowsSdkPackageMinimumRevision)' == '' ">87</WindowsSdkPackageMinimumRevision>

It doesn't check whether the app already set WindowsSdkPackageVersion, and the .NET SDK rejects having both.

The unoapp template's csproj also has a commented-out <WindowsSdkPackageVersion>10.0.22621.28</WindowsSdkPackageVersion> line suggesting this setting, so uncommenting it hits the error too.

Expected behavior 🎯

An explicit WindowsSdkPackageVersion keeps working, as it did before #25836. The default minimum revision should only apply when the app didn't pick a version.

How to reproduce it (as minimally and precisely as possible) 🔬

  1. Create a Windows-targeting project with Uno.Sdk 7.1.0-dev.78 or later (a library is enough), for example <TargetFramework>net10.0-windows10.0.26100</TargetFramework>.
  2. Add <WindowsSdkPackageVersion>10.0.26100.87</WindowsSdkPackageVersion> to the csproj (or set the WindowsSdkPackageVersion environment variable).
  3. Run dotnet build.
  4. The build fails with NETSDK1230.

Results from builds of a Windows-only library:

Uno.Sdk WindowsSdkPackageVersion Result
7.1.0-dev.78 env 10.0.19041.57 (net10, net11) NETSDK1230
7.1.0-dev.78 csproj 10.0.26100.87 (net10) NETSDK1230
7.1.0-dev.78 not set (net10, net11) builds, uses 10.0.26100.87
7.1.0-dev.21 not set builds

I also hit it in a real app on 7.1.0-dev.85 with a csproj-level 10.0.26100.86; removing the property clears it. It reproduced on .NET SDK 10.0.100, 10.0.400, and 11.0.100-rc.1 / rc.3. Public Uno.Sdk 7.0.0-dev.173 doesn't have the change.

The cause is confirmed both by these builds and by reading the targets file on current master (permalink below). The release/stable/7.0 branch has the same line, so the #25836 backport carries the problem too.

Workaround 🛠️

Remove WindowsSdkPackageVersion from the project. Setting WindowsSdkPackageMinimumRevision to an empty value should also work (not tested).

Works on UWP/WinUI

N/A (Uno.Sdk build logic).

Affected platforms 📱💻🖥️

Windows (WinAppSDK head) only.

Uno.Sdk version (and other relevant versions) 📦

Uno.Sdk 7.1.0-dev.78 and 7.1.0-dev.85, current master (6aaf325), .NET SDK 10.0.100 / 10.0.400 / 11.0.100-rc.3.

IDE version 🧑‍💻

CLI (dotnet build).

Anything else we need to know? 💬

Root cause:

<!-- Uno's Windows assemblies are built against the .87 Windows SDK projection (WinRT.Runtime 2.3). The .NET 10 SDK
defaults to .57 (WinRT.Runtime 2.2), which fails with CS1705. A minimum never lowers a newer SDK's default. -->
<WindowsSdkPackageMinimumRevision Condition=" '$(WindowsSdkPackageMinimumRevision)' == '' ">87</WindowsSdkPackageMinimumRevision>

Suggested fix (not tested): add and '$(WindowsSdkPackageVersion)' == '' to the condition, so an explicit version wins. A version older than .87 would then likely fail with CS1705, per the comment on that line, which is at least the app's own choice.

Seen first in unoplatform/uno.templates CI (unolib_Windows, net10 and net11 groups).

Introduced by #25836 (backport: #26084).

Activity

  1. added
    kind/bug
    good first issue
    triage/untriaged
    kind/regression
    area/build
    difficulty/starter 🚀
    area/sdk
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/buildarea/sdkdifficulty/starter 🚀good first issuekind/bugkind/regressiontriage/untriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions