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

Clean install on an snapdragon surface laptop 7 with vs community edition and you create a new winui project and change nothing just hit F5 and boom instant error #4779

Closed
aclinick opened this issue Oct 4, 2024 · 4 comments
Assignees
Labels
area-DeveloperTools Issues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration area-dotnet

Comments

@aclinick
Copy link

aclinick commented Oct 4, 2024

Describe the bug

Install VS community edition (doesn't seem to matter whether it's GA or preview) and create a new WinUI project. Once it's done just hit F5 and you get:

Severity Code Description Project File Line Suppression State Details
Error (active) 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:



App1 C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\buildTransitive\Microsoft.WindowsAppSDK.targets 76

Steps to reproduce the bug

See above but:

  1. Install VS community, choose desktop development and make sure to include all the .net and windows app sdk stuff
  2. Create new project select either of the winui desktop app projects
  3. Change nothing
  4. Run the app
  5. Slap forehead and curse
  6. Spend hours trying to figure out what exactly is missing so that the default project will &&() compile
  7. Ask copilot and curse whoever made it look like fisher price
  8. Ask chatgpt and curse that you have to edit the project file
  9. Edit the project file with the proposed fix
  10. Reload project file
  11. Run the app and marvel at the error message still being there
  12. Check that you have the right .net SDK installed (spoiler alert: you do)
  13. Check if you have the right Windows SDK installed. Marvel at why there isn't a command line tool to do this and then spend time trying to find sdkconfig.exe that copilot recommends that you do. (spoiler alert: you have the right version)
  14. Scratch head why windows sdk is version 10 and you're trying to target Windows 11. Have flashbacks to meetings about how changing the windows version opens a portal to hell and drown you sorrows with a fresh ice cold diet coke
  15. install the latest preview of VS community on the vague hope that it will magically solve the problem
  16. ask your friendly neighborhood windows platform architect and both wallow in wtaf is going on
  17. log this issue
  18. marvel that there's no windows 24h2 option when you select the build in the issue
  19. build a winform, react native or web page because at least you can work out what in the * is going on

Expected behavior

IJFW

Screenshots

No response

NuGet package version

Windows App SDK 1.6.1: 1.6.240923002

Packaging type

Packaged (MSIX), Unpackaged

Windows version

Insider Build (xxxxx)

IDE

Visual Studio 2022-preview, Visual Studio 2022

Additional context

No response

@aclinick
Copy link
Author

aclinick commented Oct 4, 2024

updated to preview of VS 2022 and got more fun errors

Found conflicts between different versions of "WinRT.Runtime" that could not be resolved.
There was a conflict between "WinRT.Runtime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=99ea127f02d97709" and "WinRT.Runtime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=99ea127f02d97709".
"WinRT.Runtime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=99ea127f02d97709" was chosen because it was primary and "WinRT.Runtime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=99ea127f02d97709" was not.
References which depend on "WinRT.Runtime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=99ea127f02d97709" [C:\Users\andre.nuget\packages\microsoft.windows.sdk.net.ref\10.0.19041.34\lib\net6.0\WinRT.Runtime.dll].
C:\Users\andre.nuget\packages\microsoft.windows.sdk.net.ref\10.0.19041.34\lib\net6.0\WinRT.Runtime.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windows.sdk.net.ref\10.0.19041.34\lib\net6.0\WinRT.Runtime.dll".
C:\Users\andre.nuget\packages\microsoft.windows.sdk.net.ref\10.0.19041.34\lib/net6.0/WinRT.Runtime.dll
References which depend on or have been unified to "WinRT.Runtime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=99ea127f02d97709" [].
C:\Users\andre.nuget\packages\microsoft.web.webview2\1.0.2651.64\lib_manual\net6.0-windows10.0.17763.0\Microsoft.Web.WebView2.Core.Projection.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.web.webview2\1.0.2651.64\lib_manual\net6.0-windows10.0.17763.0\Microsoft.Web.WebView2.Core.Projection.dll".
C:\Users\andre.nuget\packages\microsoft.web.webview2\1.0.2651.64\build..\lib_manual\net6.0-windows10.0.17763.0\Microsoft.Web.WebView2.Core.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.WinUI.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.InteractiveExperiences.Projection.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.InteractiveExperiences.Projection.dll".
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.InteractiveExperiences.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.WinUI.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.WinUI.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.WinUI.dll".
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.WinUI.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppLifecycle.Projection.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppLifecycle.Projection.dll".
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppLifecycle.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppNotifications.Builder.Projection.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppNotifications.Builder.Projection.dll".
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppNotifications.Builder.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppNotifications.Projection.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppNotifications.Projection.dll".
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppNotifications.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppNotifications.Builder.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.DynamicDependency.Projection.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.DynamicDependency.Projection.dll".
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.DynamicDependency.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Management.Deployment.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.Resources.Projection.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.Resources.Projection.dll".
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.Resources.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.WinUI.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll".
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Management.Deployment.Projection.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Management.Deployment.Projection.dll".
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Management.Deployment.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.PushNotifications.Projection.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.PushNotifications.Projection.dll".
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.PushNotifications.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Security.AccessControl.Projection.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Security.AccessControl.Projection.dll".
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Security.AccessControl.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Storage.Projection.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Storage.Projection.dll".
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Storage.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.System.Power.Projection.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.System.Power.Projection.dll".
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.System.Power.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.System.Projection.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.System.Projection.dll".
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.System.Projection.dll
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Widgets.Projection.dll
Project file item includes which caused reference "C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Widgets.Projection.dll".
C:\Users\andre.nuget\packages\microsoft.windowsappsdk\1.6.240923002\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Widgets.Projection.dll
This version of the Windows App SDK requires Microsoft.Windows.SDK.NET.Ref 10.0.19041.38 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:

10.0.19041.38

FYI have 8.0.402 of .NET installed and Microsoft.WindowsSDK.10.0.18362 , Microsoft.Windows.SDK.BuildTools 10.0.26100.1742 and 1.6.240923002 of Windows App SDK

dotnet --list-sdks
8.0.400 [C:\Program Files\dotnet\sdk]
8.0.402 [C:\Program Files\dotnet\sdk]

@aclinick
Copy link
Author

aclinick commented Oct 4, 2024

add

<WindowsSdkPackageVersion>10.0.19041.38</WindowsSdkPackageVersion>
to the prroject file and then you end up with :

Severity Code Description Project File Line Suppression State
Warning (active) WMC1006 Cannot resolve Assembly or Windows Metadata file 'Type universe cannot resolve assembly: WinRT.Runtime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=99ea127f02d97709.' App2 C:\Users\andre\source\repos\App2\App2\App2.csproj 1

but the app does at least run. THe question really is if this is required to make the app run why isn't it in the project file by default? Developers shouldn't have to hand edit a project file just to make a basic hello world work

@aclinick aclinick changed the title Clean install on an snapdragon surtface laptop 7 with vs community edition and you create a new winui project and change nothing just hit F5 and boom instant error Clean install on an snapdragon surface laptop 7 with vs community edition and you create a new winui project and change nothing just hit F5 and boom instant error Oct 4, 2024
@RDMacLachlan RDMacLachlan added area-DeveloperTools Issues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration area-dotnet and removed needs-triage labels Oct 7, 2024
@mominshaikhdevs
Copy link

@manodasanW

@manodasanW
Copy link
Member

The October .NET SDK servicing update has the right versions for projects with WinAppSDK 1.6 to build. This should also be available through Visual Studio updates too. The error message when we put it in did say 8.0.402 but that original release got delayed and the version got reused for a hotfix. We do have plans on looking at better coordinating such releases in the future and looking at avoiding this which is tracked by #4734.

Let me know if you still run into issues after building with the October .NET SDK update.

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 area-dotnet
Projects
None yet
Development

No branches or pull requests

4 participants