Open dongle-the-gadget opened 1 year ago
@MikeHillberg MRT searches the package graph for resources, but there's some WinUI added behavior in resource resolution. Where's the resource resolution doc'd?
Oh, so this is a problem with the system provided MRT?
Yes, or system MRT, WinUI2 and/or WinAppSDK Dynamic Dependencies mixing in some fashion the dots don't quite line up. The source path is the tipoff it's MRTSystem (aka MRT) rather than WinAppSDK's MRTCore -- onecore*
are root dirs in Windows' source tree.
An unpackaged app using WinUI2 + MRT(System) via WinAppSDK Dynamic Dependencies. Yeah, that needs a deep WinUI expert. I jus know enough to know we need one :-)
I suspect this is a gap in System MRT vis a vis WinAppSDK Dynamic Dependencies; WinUI 2 (and UWP XAML) has no say in System MRT's initialization or its search pattern.
Do you know if Windows 11 Dynamic Dependencies influence MRT's search pattern?
Do you know if Windows 11 Dynamic Dependencies influence MRT's search pattern?
Yes. MRT's search is based on the process' package graph. Dynamic Dependencies key role is to add packages to the package graph at runtime.
Dynamic changes could be unnoticed if folks cache the package graph. COM used to do this - call GetCurrentPackageInfo()
once and cache the result in a global variable. This was changed to account for dynamic dependencies (caching was removed - wasn't such a win as originally presumed). MRT never did any such caching but if WinUI's doing any such caching and not accounting for cache invalidation...
That's why MddGetPackageGraphRevisionId()
(WinAppSDK/Flat-C), Microsoft.Windows.ApplicationModel.DynamicDependency.PackageDependency.PackageGraphRevisionId
(WinAppSDK/WinRT) and GetPackageGraphRevisionId()
(Win11) exist. Those who cache package graph (directly or indirectly) can use these APIs to determine if if's changed since the last time they looked and invalidate/recompute their cache'd data.
NOTE: GetPackageGraphRevisionId()
is new in the latest version of Windows. There's a GetCurrentPackageInfo3() one can use on older systems
@MikeHillberg @bpulliam would know if WinUI's caching the package graph or otherwise altering the MRT's behavior
Any progress?
Oh, I got this error, too. Never thought someone had encountered it, interesting. Any progress on this?
Describe the bug
When using Windows App SDK Dynamic Dependencies (
MddTryCreatePackageDependency
andMddAddPackageDependency
), WinUI 2 isn't able to load the appropriate resources.Steps to reproduce the bug
Problematic code:
Project configuration:
PropertyGroup
:Expected behavior
WinUI 2 should be able to find the resources.
Screenshots
No response
NuGet package version
Windows App SDK 1.2.1: 1.2.221116.1
Packaging type
Unpackaged
Windows version
Insider Build (xxxxx)
IDE
Visual Studio 2022-preview
Additional context
Using Windows 11 Dynamic Dependencies (
TryCreatePackageDependency
andAddPackageDependency
) doesn't cause this problem.