dotnet pack produces an invalid symbols package under linux
The following repository contains scripts and a sample project to reproduce the issue. You will need docker installed.
https://bitbucket.org/sheltony/dotnetpackbug
The sample dotnet project contains two classes
- dotnetPackBug.Class1
- dotnetPackBug.Namespace.Class2
To run this, just execute run.ps1
You'll end up with two folders WindowsOut and LinuxOut, Each of which will have dotnetPackBug.1.0.0.symbols.nupkg, which you can use to observe the following:
When creating a symbols package under windows, the output symbols.nupkg output contains a valid package. Inside the nupkg. we have a src folder with the following structure.
WindowsOut/dotnetPackBug.1.0.0.symbols.nupkg
src
dotnetPackBug
Namespace
Class2.cs
dotnetPackBug.csproj
Class1.cs
However, under linux, the same command produces a package with the following incorrect structure:
LinuxOut/dotnetPackBug.1.0.0.symbols.nupkg
src
dotnetPackBug
dotnetPackBug.csproj
Class1.cs
You can see that any source files that are not at the root level in the dotnet project (e.g. everything in a namespace) are not included in the symbols package in the src folder. They're in fact included in the package at the wrong level (the root level of the package).
Moving this to NuGet so that they can have first look. If this turns out to be an issue in the SDK, please move it back.
This issue was moved to NuGet/Home#6160