Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LegendaryBlair opened this issue Nov 7, 2024 · 2 comments
Open
Assignees
Labels
area-DeveloperTools Issues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration

Comments

@LegendaryBlair
Copy link

LegendaryBlair commented Nov 7, 2024

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>

@LegendaryBlair LegendaryBlair self-assigned this Nov 7, 2024
@RDMacLachlan RDMacLachlan added area-DeveloperTools Issues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration and removed needs-triage labels Nov 7, 2024
@manodasanW
Copy link
Member

Looks like we will need a check for when someone is not targeting the Windows OS version target framework which I assume was the case here.

@dotMorten
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-DeveloperTools Issues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration
Projects
None yet
Development

No branches or pull requests

4 participants