microsoft / devhome

The new Dev Home experience for Windows!
https://aka.ms/devhomedocs
MIT License
3.49k stars 307 forks source link

PI: WinUI + WASDK check misses WinUI 2/C++ programs #3266

Closed dongle-the-gadget closed 17 hours ago

dongle-the-gadget commented 4 weeks ago

Dev Home version

0.1501.533.0

Windows build number

10.0.26241.5000

Other software

No response

Steps to reproduce the bug

  1. Open Project Ironsides.
  2. Select a C++ WinUI 3 app or any WinUI 2 app (such as Windows Explorer, Microsoft Store).
  3. Notices that WinUI is unchecked in "App details".
  4. Detach the process and select any C++ Windows App SDK app (such as Windows Explorer).
  5. Notices that Windows App SDK is unchecked in "App details".

Expected result

For WinUI 2 apps, "WinUI" should be checked. For C++ WinUI 3 apps, "WinUI" and "Windows App SDK" should be checked. For C++ Windows App SDK apps that don't use WinUI, "Windows App SDK" should be checked.

Actual result

Both the "WinUI" and "Windows App SDK" checkboxes are unchecked.

Included System Information

No response

Included Extensions Information

No response

dongle-the-gadget commented 4 weeks ago

Taking a glance at the code, it seems like Project Ironsides is checking two DLLs for the checks (both being wrong):

Microsoft.WinUI.dll is the C#/WinRT projection DLL for WinUI 3, and as such only C# WinUI 3 apps use it. A more accurate DLL to check for is Microsoft.UI.Xaml.dll, which is also used by WinUI 2.

Microsoft.Windows.SDK.NET.dll is the C#/WinRT projection for the Windows SDK. This means that only .NET apps get picked up, and also .NET apps that use the Windows TFM for Windows SDK access get the checkmark even if they don't use the Windows App SDK.

There's no easy way to do an accurate check on the latter though, since the Windows App SDK has many DLLs and each major update can add a few more to the list. In addition, applications can opt for either framework-dependent or self-contained deployment, so checking package dependencies is also unreliable.