Skip to content

fix(Target): Add desktop and winSdk flag to recognized Targets#418

Open
DevTKSS wants to merge 6 commits into
unoplatform:mainfrom
DevTKSS:add-target-values-for-desktop-and-winsdk
Open

fix(Target): Add desktop and winSdk flag to recognized Targets#418
DevTKSS wants to merge 6 commits into
unoplatform:mainfrom
DevTKSS:add-target-values-for-desktop-and-winsdk

Conversation

@DevTKSS
Copy link
Copy Markdown
Contributor

@DevTKSS DevTKSS commented Jun 28, 2025

GitHub Issue: closes #404,

Partially/maybe solving: #352

PR Type:

  • 🐞 Bugfix

What is the current behavior? 🤔

the target flag does not recognize these values, while these are the ones the extension

What is the new behavior? 🚀

As I am not able to test the actual extension, this only applyes on the CLI itself from the code!
added the cases for the GetTargetPlatformFromFlag(targetFlag) which is called in:

private TargetPlatform GetApplicableTargetsForWorkload(VSWinWorkload workload)
{
var output = TargetPlatform.None;
if (workload.RequiredBy is { } requiredBy)
{
foreach (var targetFlag in requiredBy)
{
var target = TargetPlatformHelper.GetTargetPlatformFromFlag(targetFlag);
output |= target;
}
}
return output;
}

and:

public static TargetPlatform GetTargetPlatformsFromFlags(string[]? targetPlatformFlags)
{
if (targetPlatformFlags == null || targetPlatformFlags.Length == 0)
{
return TargetPlatform.All;
}
var output = TargetPlatform.None;
foreach (var flag in targetPlatformFlags)
{
output |= GetTargetPlatformFromFlag(flag);
}
return output;
}

PR Checklist ✅

Please check if your PR fulfills the following requirements:

Other information ℹ️

Comment thread UnoCheck/TargetPlatformHelper.cs Outdated
case "winappsdk":
case "wasdk":
case "winappsdk":
case "winsdk":
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you add this one specifically? Is it documented somewhere and the tool does not support it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeromelaban the name "winsdk" would by pure commonly understandment make more sense then "wasdk" below. so if I would be new to this, I would refer to the WindowsAppSdk as WinAppSdk (auto transfer to lowercase of course here) which is line 49 or in short therm as "WinSdk" as you could check google pointing as "Windows Sdk" e.g. in my localization:
image

so maybe I would rather ask, except from finding the "wasdk" name in the uno docs, I would not come to the idea as new user to ask for this target by naming it wasdk. Indeed, I was really surprised that someone would refer as wasdk to it because in my opinion I would rather think of that could be mistaken as we do have a very similar named member for the WebAssembly with common short name of "wasm" =! Win App Sdk

strange, that GH is showing this sometimes as seperate review 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @jeromelaban ,
this might have slipped through the cracks, so here’s a quick ping regarding my earlier comment. Happy to proceed once you have a chance to review it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

winsdk is not the same thing as winappsdk, let's not add it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeromelaban removed 👍 are you fine with adding the desktop target then? we are naming it in the TFM list in csproj like that and as "skiadesktop" can be mistaken to be closely related to the Uno.Sdk 6.+ SkiaRenderer Feature from User perspective, it would make sense to allow impling the TargetPlatform.SkiaDesktop on code side 💡
The win32desktop compared to this to imply TargetPlatform.Windows is making me as Windows User indeed more worried. Can you tell what difference Uno check is making between when using Windows as TFM (which is not equal to WinAppSdk since this has its own case area above this) compared to SkiaDesktop ?

I mean, yes, of course, Desktop also covers Linux etc in general, which are not Windows, but our Uno Apps will use the *-windows* flag always when we do use the WinAppSdk, so if I would not know this cases here, which I only looked up, exactly because I wanted to only check the requirements for net*.0-desktop to develop on a Windows Maschine, but I wanted to:

  • Use SkiaRenderer Feature

    *(not sure if we now meanwhile since introduction of the SkiaRenderer Uno Feature can use this alongside the *-windows* TFM too, but I would assume not, I did not hear from this 🤔

  • Wanted to show my boss the really nice Benefits of the ability to use Hot Reload, so he would buy a license for me and my collegues at work then

  • The Apps I am developing to automate CAD Mechanical Engineering Workflows with Autodesk Inventor are only available on Windows Host Maschines + NO NuGet for this Autodesk.Inventor.Interop.dll available by now and I think they are requiring to use a manifest file, so I still want to try out if I can use Uno with its very great UI 💡

    up to 1 Versions past the most recent of this application, it was requiring .NET Framework 4.x so the only guidiance and compartibility layer has been WinForms and WPF. Now with the 2 last Versions they released, they introduced a Breaking Change and now its requiring .NET 8+. I tested already in a POCO if I can reference the .NET Framework version with an .NET 9 Uno app, which was successfull so I would defintly see future in making Dev Collegues in this area aware of using Uno 😃

    But if those will check Uno out to be used for the future UI Layer, I am sure, that I will not be the only one, who would not want / be allowed to install for this szenario:

    • WSL
    • Android Emulators

those targets are just not relevant for this and at least I find it really really annoying to have Uno Check all the time tell me, that it found issues just because of those pesky checks will never pass. 👀

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[uno-check] [WinSdk][Desktop][Banner][CLI][VS2022] "Found problems banner" --target flags not recognized

2 participants