dotnet pack doesn't preserve directory structure for included files.
See original GitHub issueSteps to reproduce
Run dotnet pack
on the below project which has
"packOptions": {
"files": {
"mappings": {
"Templates/": "Templates/"
}
}
}
https://github.com/prafullbhosale/PackRepro
Expected behavior
The generated nupkg has the directory structure
/Templates
|__ Folder1
|__File.txt
|__ Folder2
|__File.txt
Actual behavior
/Templates
|__File.txt
|__File.txt
Environment data
dotnet --info
output:
D:\Projects\pack>dotnet --info
.NET Command Line Tools (1.0.0-rc2-002543)
Product Information:
Version: 1.0.0-rc2-002543
Commit Sha: 38d0c28a1e
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
dotnet pack (.NET 5) creates extra folder for files with no ...
dotnet pack creates extra folder for files with no extension when packing staticwebassets. The package . props however contains the correct ...
Read more >Dotnet pack - include referenced projects
When running dotnet pack and having references to other projects, the following nuspec file will be produced:
Read more >MSBuild reference for .NET SDK projects
Reference for the MSBuild properties and items that are understood by the .NET SDK.
Read more >Multi-targeting for NuGet Packages
If a framework folder is left empty, NuGet doesn't add assembly references or content files or run the PowerShell scripts for that framework....
Read more >Create and publish a NuGet package with the dotnet CLI
Open the .csproj, .fproj, or .vbproj project file, and add the following properties inside the existing <PropertyGroup> tag. Use your own values ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Since we have ample workarounds, putting in rtm milestone.
Spoke to @pranavkm. Symbol packages have been using the wrong folder structure before the schema changes and using compile include actually fixes the problem but also breaks the assumptions. So no change is currently needed for this other that to add a test to verify this scenario. I’ll file an issue in repos that need to be updated to use the new structure.