Skip to content

Build error occurred when C# console app installed WinAppSDK 1.6 #4854

Open

Description

Describe the bug

I have a simple C# console app for .Net 6, installing Win app SDK 1.6 and then build is failing with the error message:

This version of the Windows App SDK requires Microsoft.Windows.SDK.NET.Ref  or later.
    Please update to .NET SDK 6.0.134, 6.0.426, 8.0.109, 8.0.305 or 8.0.402 (or later).
    Or add a temporary Microsoft.Windows.SDK.NET.Ref reference which can be added with:
        <PropertyGroup>
            <WindowsSdkPackageVersion></WindowsSdkPackageVersion>
        </PropertyGroup>
	Issue2338-4	F:\packages\NuGet\cache\microsoft.windowsappsdk\1.6.240923002\buildTransitive\Microsoft.WindowsAppSDK.targets	76	

Steps to reproduce the bug

  1. Create a simple C# console app for .NET 6
  2. Install Win app SDK 1.6 through .nuget package
  3. Build the project

Expected behavior

No build error.

Screenshots

Image

NuGet package version

Windows App SDK 1.6.1: 1.6.240923002

Packaging type

Unpackaged

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

The message is not actionable, I already installed .NET SDK 6.0.427, which is greater than .NET SDK 6.0.426 mentioned in the error message.
NOTE: in the .NET download page https://dotnet.microsoft.com/en-us/download/dotnet/6.0, there's no .NET SDK 6.0.426.

dotnet --list-sdks
6.0.427 [C:\Program Files\dotnet\sdk]
8.0.403 [C:\Program Files\dotnet\sdk]

NOTE: Workaround exists. I need to manually update the csproj to the following to make it work.
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

area-DeveloperToolsIssues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions