Skip to content

Upgrading to v1.8 breaks ResourceLoader in unpackaged apps #19

@qiutongMS

Description

@qiutongMS

Describe the bug

When updating from v1.7 to v1.8 my app (DLSS Swapper) no longer launches. Constructing Windows.ApplicationModel.Resources.ResourceLoader causes the app to crash. There is a repro linked below.

The error appears to come from WinRT.Runtime.dll and is

System.IO.FileNotFoundException: Unable to find the specified file.

The full stacktrace is,

at WinRT.ExceptionHelpers.g__Throw|38_0(Int32 hr)
at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
at ABI.WinRT.Interop.IActivationFactoryMethods.ActivateInstanceUnsafe(IObjectReference objectReference, Guid iid)
at Windows.ApplicationModel.Resources.ResourceLoader..ctor()
at ResourceLoaderTest.MainWindow.Grid_Loaded(Object sender, RoutedEventArgs e) in D:\git\beeradmoore\WindowsAppSDK_ResourceLoaderIssue\ResourceLoaderTest\ResourceLoaderTest\MainWindow.xaml.cs:line 37

I was not able to reproduce the issue in a packaged app.

Comparing the files in bin between the two I notice that v1.7 produces resources.pri whereas v1.8 produces ResourceLoaderTest.pri. If I put the app config in its broken state and confirm it does not work as intended, but then copy/paste ResourceLoaderTest.pri to resources.pri it will now work as expected.

Steps to reproduce the bug

See the project in this repo: https://github.com/beeradmoore/WindowsAppSDK_ResourceLoaderIssue

  1. Run the project in debug mode (runs as unpackaged by default).
  2. Observe that the first Debugger.Break(); is hit indicating ResourceLoader constructed
  3. Update nuget package from 1.7.250606001 to 1.8.250907003
  4. Run the project again and now observe you hit the Debugger.Break(); in the catch statement.

Expected behavior

The first Debugger.Break(); is hit in both cases.

Screenshots

No response

NuGet package version

Windows App SDK 1.8.0: 1.8.250907003

Packaging type

Unpackaged

Windows version

Windows 11 version 24H2 (26100, June 2025 Update)

IDE

Visual Studio 2022

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-DeploymentIssues related to packaging, installation, runtime (e.g., SelfContained, Unpackaged)area-MRTCoreResourceManagerbugSomething isn't workingneeds-triage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions