WindowsAppSDK icon indicating copy to clipboard operation
WindowsAppSDK copied to clipboard

Incorrect v1.6exp1 error

Open dotMorten opened this issue 1 year ago • 1 comments

Describe the bug

When adding the latest 1.6.240531000-experimental1 nuget package, I'm met with the following error:

1>C:\Users\mn\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.WindowsAppSDK.targets(84,9): error : This version of the Windows App SDK requires Microsoft.Windows.SDK.NET.Ref 10.0.19041.35-preview;10.0.19041.35-preview or later, which can be added with:
1>C:\Users\mn\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.WindowsAppSDK.targets(84,9): error :         <PropertyGroup>
1>C:\Users\mn\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.WindowsAppSDK.targets(84,9): error :             <WindowsSdkPackageVersion>10.0.19041.35-preview;10.0.19041.35-preview</WindowsSdkPackageVersion>
1>C:\Users\mn\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.WindowsAppSDK.targets(84,9): error :         </PropertyGroup>
1>C:\Users\mn\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.WindowsAppSDK.targets(84,9): error :

Adding this to the project will result in a build-error. The string 10.0.19041.35-preview;10.0.19041.35-preview should be changed to 10.0.19041.35-preview

Steps to reproduce the bug

  1. Create a new WinUI project.
  2. Update the nuget package to latest WindowsAppSDK 1.6.240531000-experimental1

Expected behavior

Don't repeat the version number inside the WindowsSdkPackageVersion tag twice

1>C:\Users\mn\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.WindowsAppSDK.targets(84,9): error : This version of the Windows App SDK requires Microsoft.Windows.SDK.NET.Ref 10.0.19041.35-preview;10.0.19041.35-preview or later, which can be added with:
1>C:\Users\mn\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.WindowsAppSDK.targets(84,9): error :         <PropertyGroup>
1>C:\Users\mn\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.WindowsAppSDK.targets(84,9): error :             <WindowsSdkPackageVersion>10.0.19041.35-preview</WindowsSdkPackageVersion>
1>C:\Users\mn\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.WindowsAppSDK.targets(84,9): error :         </PropertyGroup>
1>C:\Users\mn\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.WindowsAppSDK.targets(84,9): error :

Screenshots

image

NuGet package version

Windows App SDK 1.6 Experimental 1: 1.6.240531000-experimental1

Packaging type

No response

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

No response

dotMorten avatar Jun 05 '24 18:06 dotMorten

Thanks @dotMorten - will be fixed in the Experimental 3 release.

Scottj1s avatar Jun 07 '24 23:06 Scottj1s

The error message indicates that you need to add somewhere:

<PropertyGroup>
    <WindowsSdkPackageVersion>10.0.19041.35-preview;10.0.19041.35-preview</WindowsSdkPackageVersion>
</PropertyGroup>

and when you double-click the error message, it opens the file Microsoft.WindowsAppSDK.targets which is inside the cached NuGet packages. If possible, it might be better if it opens the project file instead.

AndrewKeepCoding avatar Jul 05 '24 08:07 AndrewKeepCoding

That's not quite how errors thrown by build .target files work though. Visual studio opens build errors where they occur

dotMorten avatar Jul 05 '24 13:07 dotMorten

Yeah. I figured. How about mentioning "project file" in the error message? I think that it's confusing for devs new with .NET projects😅

AndrewKeepCoding avatar Jul 05 '24 14:07 AndrewKeepCoding

Fixed in WinAppSDK 1.6 Preview 2

Scottj1s avatar Aug 27 '24 17:08 Scottj1s

Had the same error with a new freshly made project in VS 2022. Fixed it by adding:

<WindowsSdkPackageVersion>10.0.26100.38</WindowsSdkPackageVersion>

after

    <TargetFramework>net8.0-windows10.0.26100.0</TargetFramework>
    <SupportedOSPlatformVersion>10.0.20348.0</SupportedOSPlatformVersion>
    <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>

image

gabriel-vanca avatar Sep 11 '24 21:09 gabriel-vanca

@gabriel-vanca the issue was that error message was wrong (values repeated). Already fixed in 1.6.0

dotMorten avatar Sep 11 '24 21:09 dotMorten

Well, I'm on version 1.6 and I'm still having the issue. Unless I've seriously misconfigured something.

image

image

gabriel-vanca avatar Sep 12 '24 02:09 gabriel-vanca

@gabriel-vanca The generated error isn't the bug (it's actually quite helpful since it is required for now - see release notes). The message in the error was the issue and it is fixed. The error before the fix was: <WindowsSdkPackageVersion>10.0.19041.35-preview;10.0.19041.35-preview</WindowsSdkPackageVersion> where the error was supposed to be: <WindowsSdkPackageVersion>10.0.19041.35-preview</WindowsSdkPackageVersion> Your screenshot confirms you have the correct message.

dotMorten avatar Sep 12 '24 05:09 dotMorten

Get it now. Thanks!

gabriel-vanca avatar Sep 12 '24 14:09 gabriel-vanca

I create a new empty WinUI3 project and it doesn't compile. Isn't this an error, you say? :)

mcyenikoylu avatar Sep 14 '24 18:09 mcyenikoylu

Yes, I agree a default template not compiling should be treated more seriously.

gabriel-vanca avatar Sep 14 '24 20:09 gabriel-vanca

Tracking future improvement here via #4734.

codendone avatar Sep 26 '24 22:09 codendone