2

In Visual Studio 2019 using the new project file format with the Pack command how do I include the .pdb files in the package and how do I ensure they are copied into the output when the package is installed?

Jack J Jun
  • 5,633
  • 1
  • 9
  • 27
  • Does this answer your question? [Include pdb files into my nuget (nupkg) files](https://stackoverflow.com/questions/41713693/include-pdb-files-into-my-nuget-nupkg-files) The accepted answer is about if you have a nuspec file (which you don't), but there are other answers about changes to the csproj file and additional `dotnet pack` command arguments. – gunr2171 Mar 30 '21 at 13:53
  • So, if I use the tip there of "true" in the project file the Pack outputs the .pdb files in the package. However, when I install the package I do not get the .pdb files. What is the 2nd step? – TerrierJack Mar 30 '21 at 14:54
  • I made an empty .Net 5 class library, included `true` in the csproj file, then ran `dotnet pack`, and I got two nupkg files, one of which included the dll and the pdb. – gunr2171 Mar 30 '21 at 15:03
  • See [Creating symbol packages (.snupkg)](https://learn.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg). – Theraot Mar 31 '21 at 01:31
  • 1
    Yeah - I read that and I include the line IncludeSymbols and I don't care whether my Azure DevOps can have a Symbol Server. I want to include the .pdb files in the application output directory. Does anyone know how to do that? The Pack command produces a package of *.symbols.nupkg that includes the .pdb file and the .dll file but when I install the that package the output directory only has the .dll. I want the .pdb file in the output so I can distribute it. – TerrierJack Mar 31 '21 at 12:16
  • https://github.com/dotnet/sourcelink/blob/main/README.md#alternative-pdb-distribution – more urgent jest Aug 15 '22 at 03:57

0 Answers0