question-mark
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.

How to ship a nuget package with embedded pdbs

See original GitHub issue

I was wondering, what kinds of hoops I’d have to jump through to make this work?

I have a .csproj file like this:

<PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <DebugType>Embedded</DebugType>
    <EmbedAllSources>True</EmbedAllSources>
  </PropertyGroup>

  <PropertyGroup>
    <PackageId>Some.Sample.Package</PackageId>
    ...
  </PropertyGroup>

but when using the nuget package built from this csproj using dotnet pack and I try stepping into an API, VS asks me where to get the source file… Isn’t that supposed to be embedded?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
tmatcommented, Feb 19, 2019

Isn’t it also necessary to include: <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder> In the top PropertyGroup?

It is not. The project sets DebugType to embedded, which means the PDB is going to be embedded to the DLL. Furthermore, the project also sets EmbedAllSources meaning the sources are going to be embedded into the PDB. This approach is the best when the resulting size of the DLL is not an issue, as the debugger doesn’t need to find the PDB on a symbol server and the sources on the source server. Everything is embedded in a single file (the DLL).

1reaction
enziancommented, Feb 20, 2019

Oh, actually, when I used “Step into specific” to step into the library methods then it asked me to disable “Just my Code” and then it worked! Cool!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Include pdb files into my nuget (nupkg) files
In order to include your pdb files you just have to enter the tag <IncludeSymbols>true</IncludeSymbols> in a PropertyGroup in your project's .
Read more >
Creating symbol packages (.snupkg) - NuGet
How to create NuGet symbol packages (snupkg). ... It's also possible to embed them in the dll or exe with the following project...
Read more >
Two Easy Ways to Debug NuGet Packages and Edit Libraries
Embedded Symbols packages are the most straightforward and recommended approach, especially with ProGet. They include the PDB and DLL inside a ...
Read more >
Debugging into NuGet packages with Source Link
In this article ... Source Link technology enables source code debugging of .NET assemblies from NuGet that ship .PDBs with links to source...
Read more >
Symbols and Symbol Packages, Explained
You've heard of Symbols and Symbol packages. They're a great tool for debugging your NuGet packages – some of the most fiddly packages...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found