dotnet / dotnet/project-system

Files added to resource files in sub-folders using new editor are generated with incorrect path in .resx

Open
#9,622 1 comment 0 reactions 1 assignee Claimed by @zewditu View on GitHub
Feature-Resource-Explorer Triage-Approved
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

## Visual Studio Version
17.12.3

## Summary
When adding a file such as an image to a resources file contained within a project sub-folder using the new editor, the .resx file is generated with an incorrect path.

## Steps to Reproduce

1. Create a new class library project.
2. Add a new folder inside the project.
3. Add a resources file inside the folder.
4. Add an existing file or image to the resource file.
5. The project will not build due to an error finding the file.

## Expected Behavior
The file should be referenced from the root Resources folder and available to use when referencing the resource file.

## Actual Behavior
The project now fails to build, as the path within the .resx file is relative to the sub-folder the resources file is in, but the actual file is placed in a "Resources" folder in the project root.

![Image](https://github.com/user-attachments/assets/2f3ea32c-f128-4623-b3df-12df37a31f31)
![Image](https://github.com/user-attachments/assets/e9423bd9-752e-4752-9ac4-472b26f06e41)
![Image](https://github.com/user-attachments/assets/b0a1ddc6-9e5b-4fed-859a-af390ffe421a)
![Image](https://github.com/user-attachments/assets/af176f2e-3e34-4b7c-b167-30ed809f313c)

## User Impact
Requires manually editing the generated resx.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.