Skip to content
New issue

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

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

Already on GitHub? # to your account

Microsoft.Windows.SDK.NET.Ref error coming when debugging WinApp SDK #951

Closed
Darsh0307 opened this issue Sep 11, 2024 · 7 comments
Closed
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.

Comments

@Darsh0307
Copy link

Current behavior

When creating an application with the 5.5 dev and running with WinApp SDK as the debugging target then in those cases there is a wired error coming asking us to change the Windows.SDK.NET , telling us to add a new PropertyGroup in the .csproj file. The error is coming with 5.5 dev version only.

Here is the message in error list.

Screenshot 2024-09-11 at 3 27 36 PM

Here is the result of Build in output tab.

rogram Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2412,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\DarshPatel\.nuget\packages\uno.winui\5.5.0-dev.227\lib\net8.0-windows10.0.19041.0\Uno.UI.Toolkit.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2412,5): warning MSB3277:             C:\Users\DarshPatel\.nuget\packages\uno.winui\5.5.0-dev.227\lib\net8.0-windows10.0.19041.0\Uno.UI.Toolkit.dll
1>C:\Users\DarshPatel\.nuget\packages\microsoft.windowsappsdk\1.6.240829007\buildTransitive\Microsoft.WindowsAppSDK.targets(76,9): error : This version of the Windows App SDK requires Microsoft.Windows.SDK.NET.Ref 10.0.19041.38 or later.
1>C:\Users\DarshPatel\.nuget\packages\microsoft.windowsappsdk\1.6.240829007\buildTransitive\Microsoft.WindowsAppSDK.targets(76,9): error :     Please update to .NET SDK 6.0.134, 6.0.426, 8.0.109, 8.0.305 or 8.0.402 (or later).
1>C:\Users\DarshPatel\.nuget\packages\microsoft.windowsappsdk\1.6.240829007\buildTransitive\Microsoft.WindowsAppSDK.targets(76,9): error :     Or add a temporary Microsoft.Windows.SDK.NET.Ref reference which can be added with:
1>C:\Users\DarshPatel\.nuget\packages\microsoft.windowsappsdk\1.6.240829007\buildTransitive\Microsoft.WindowsAppSDK.targets(76,9): error :         <PropertyGroup>
1>C:\Users\DarshPatel\.nuget\packages\microsoft.windowsappsdk\1.6.240829007\buildTransitive\Microsoft.WindowsAppSDK.targets(76,9): error :             <WindowsSdkPackageVersion>10.0.19041.38</WindowsSdkPackageVersion>
1>C:\Users\DarshPatel\.nuget\packages\microsoft.windowsappsdk\1.6.240829007\buildTransitive\Microsoft.WindowsAppSDK.targets(76,9): error :         </PropertyGroup>
1>C:\Users\DarshPatel\.nuget\packages\microsoft.windowsappsdk\1.6.240829007\buildTransitive\Microsoft.WindowsAppSDK.targets(76,9): error :
1>Done building project "blankCLI.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 3:21 PM and took 00.925 seconds ==========

Expected behavior

It should build the app without having any error when debugging with WinApp SDK as debugging target.

Affected platforms

Windows (WinAppSdk)

Template Host

dotnet new

Host OS

Windows

Template Options

  1. The App was a blank project created using dotnet new templates.
    Here is the command used to create using blank project. dotnet new unoapp -preset=blank -o test
  2. Select WinApp SDK as the debugging target.
  3. Try debugging it
  4. Open the builds in output tab.

Template Version

PS C:\Users\DarshPatel> dotnet new details Uno.templates
Uno.Templates
   Package version: 5.5.0-dev.7
   Reserved: True
   Details: Templates for creating Uno Platform apps and libraries
   Source Feed: nuget.org [https://api.nuget.org/v3/index.json]
   Authors:
      Uno Platform
   Owners:
      https://nuget.org/profiles/unoplatform
   License Metadata:
      License: Apache-2.0
   License Expression: https://licenses.nuget.org/Apache-2.0
      License Url: https://www.nuget.org/packages/Uno.Templates/5.5.0-dev.7/license
      Repository Url: https://github.com/unoplatform/uno.templates
PS C:\Users\DarshPatel>

Anything else we need to know?

Visual Studio Version:- 17.11.3

@Darsh0307 Darsh0307 added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels Sep 11, 2024
@Darsh0307
Copy link
Author

blankCLI.zip

@Darsh0307
Copy link
Author

@jeromelaban The issue is still happening in 5.5.0-dev.21

@jeromelaban
Copy link
Member

There is no fix available for this. If you do not see any related change, the issue is likely still present.

@Darsh0307
Copy link
Author

No worries , Sounds good @jeromelaban

@Darsh0307
Copy link
Author

Darsh0307 commented Sep 23, 2024

@jeromelaban

@jhanvi03 and I are able to reproduce this issue wtih 5.4 stable version also.

Uno.sdk / Uno.templaets :- 5.4.2

cc @agneszitte

@jeromelaban
Copy link
Member

We're not able to fix issue at this time, as it breaks for multiple reasons (mono/SkiaSharp#2999). Make the modification manually to get around it by adding <WindowsSdkPackageVersion>10.0.19041.38</WindowsSdkPackageVersion>.

@jeromelaban
Copy link
Member

Fixed in 5.4.5 and later (74a36bf)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.
Projects
None yet
Development

No branches or pull requests

2 participants