Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet pack doesn't preserve directory structure for included files.

See original GitHub issue

Steps to reproduce

Run dotnet pack on the below project which has

"packOptions": {
    "files": {
      "mappings": {
        "Templates/": "Templates/"

Expected behavior

The generated nupkg has the directory structure

      |__ Folder1
      |__ Folder2

Actual behavior


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:closed
  • Created 7 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

TheRealPiotrPcommented, May 3, 2016

Since we have ample workarounds, putting in rtm milestone.

ajaybhargavbcommented, May 4, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found