dotnet / dotnet/NuGet.BuildTasks
ContentFiles: Embedded resources are always flattened
- Dominant language
- PowerShell
- Stars
- 47
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Description
When a NuGet package is created with content files in a nested directory structure, the (manifest) resource names of the embedded resources that are created for these files do not contain the relative directory path (with slashes converted to dots).
### Steps to reproduce:
1. Create a **NuGet** package with the following content:
```
contentFiles
any
any
sub
myResource.txt
```
2. In the **.nuspec** for this package, add the following fragment to the metadata element:
```xml
```
3. Pack & Publish the **NuGet** package.
4. Create (for example) a **C# Console App** project named **ConsoleApp1** (with default namespace **ConsoleApp1**¨) in Visual Studio (15.8).
5. Ensure that the default package management format is **PackageReference** in the *NuGet Package Manager Settings**.
6. Add a reference to the **NuGet** package that we published in step **3**.
7. Build the project.
### Expected result:
The **myResource.txt** file is embedded in the **ConsoleApp1.exe** assembly with the name 'ConsoleApp1.sub.myResource.txt'.
### Actual result:
The **myResource.txt** file is embedded in the **ConsoleApp1.exe** assembly with the name 'ConsoleApp1.myResource.txt'.
NuGet product used: VS UI (15.8.1)
OS version: Windows 7 Build 7601
Moved from: https://github.com/NuGet/Home/issues/7255
cc @drieseng @tmeschter
Contributor guide
Assessment
This issue has not been assessed yet.