Skip to content

MrmGetFilePathFromName violates its document #5940

@Berrysoft

Description

@Berrysoft

Describe the bug

The document and comments of this method indicates that it will always succeed even if the app doesn't have a PRI file.

// A file path is always returned even if none of the files under the above mentioned searching
// criteria exists. In that case, we will return filename (if provided) or resources.pri (if name not
// provided) under module file path. The reason is that we don't want to fail the creation of
// ResourceManager even if an app doesn't have PRI file.

However, it returns ERROR_FILE_NOT_FOUND:

return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);

I have created #5828 to fix it, but no one takes care of it.

Steps to reproduce the bug

Create a WinUI3 program without PRI files. I know it's a little hard, but see:

#5814

Alovchin91/winui3-rs#5

Expected behavior

The behavior of the method should match its document.

Screenshots

No response

NuGet package version

Windows App SDK 1.8.2: 1.8.251003001

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions