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

1.6 Preview 1: Breaks resource lookups from referenced libraries using full resource paths. Exception: 'ResourceMap Not Found'. #4669

Closed
AdriaanLarcai opened this issue Aug 21, 2024 · 2 comments
Labels
area-DeveloperTools Issues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration area-MRTCore ResourceManager

Comments

@AdriaanLarcai
Copy link

Describe the bug

Apps that reference libraries or library projects that contain either resx or resw resource files can no longer do resource lookups using their full paths.
Resource lookups via ResourceLoader.GetForViewIndependentUse() and passing a resource path such as "App1Library/Resources" throw the following exception:

image

System.Runtime.InteropServices.COMException
HResult=0x80073B1F
Message=ResourceMap Not Found.

ResourceMap Not Found.

Source=WinRT.Runtime
StackTrace:
at WinRT.ExceptionHelpers.g__Throw|38_0(Int32 hr)
at ABI.Windows.ApplicationModel.Resources.IResourceLoaderStatics2Methods.GetForViewIndependentUse(IObjectReference _obj, String name)
at Windows.ApplicationModel.Resources.ResourceLoader.GetForViewIndependentUse(String name)

This exception was originally thrown at this call stack:
WinRT.ExceptionHelpers.ThrowExceptionForHR.__Throw|38_0(int)
ABI.Windows.ApplicationModel.Resources.IResourceLoaderStatics2Methods.GetForViewIndependentUse(WinRT.IObjectReference, string)
Windows.ApplicationModel.Resources.ResourceLoader.GetForViewIndependentUse(string)
AIForged.Helpers.ResourceExtensions.GetLocalized(string, string) in Tools.ResourceExtensions.cs

This even affects controls from vendors such as Syncfusion.

Steps to reproduce the bug

  1. Create a WinUI 3 class library with WindowsAppSDK 1.6 Preview 1 and call it App1Library.
    1.1 Add a resource (resx or resw) file and add some strings to it.

  2. Create a WinUI 3 desktop app with WindowsAppSDK 1.6 Preview 1.
    2.1 Add a reference to App1Library
    2.2 Attempt to retrieve a resource via ResourceLoader.GetForViewIndependentUse() using the full resource path such as "App1Library/Resources".

Expected behavior

This worked in 1.5 and earlier versions.

Screenshots

image

NuGet package version

Windows App SDK 1.6 Preview 1: 1.6.240807006-preview1

Packaging type

Packaged (MSIX), Unpackaged

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

No response

@codendone
Copy link
Contributor

Potentially the same as, or related to, #4649.

@codendone codendone added area-DeveloperTools Issues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration area-MRTCore ResourceManager labels Aug 22, 2024
@codendone
Copy link
Contributor

This should be fixed with the change for #4649. Please let us know if you still repro this with 1.6-preview2.

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-MRTCore ResourceManager
Projects
None yet
Development

No branches or pull requests

2 participants