From edbfc6bf91b3d1d05e8b4b8e7d75509a40c5c95e Mon Sep 17 00:00:00 2001 From: Matt Kotsenas Date: Wed, 28 Aug 2024 10:04:28 -0700 Subject: [PATCH] Refactor "PDB distributions" section of README --- README.md | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index ab581e87..9df84f88 100644 --- a/README.md +++ b/README.md @@ -208,16 +208,6 @@ The VC++ linker supports `/SOURCELINK` [switch](https://docs.microsoft.com/en-us If you distribute the library via a package published to [NuGet.org](http://nuget.org), it is recommended to build a [symbol package](https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg) and publish it to [NuGet.org](http://nuget.org) as well. This will make the symbols available on [NuGet.org symbol server](https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg#nugetorg-symbol-server), where the debugger can download it from when needed. -Alternatively, Portable PDBs can be included in the main NuGet package by setting the following property in your project: - -```xml - - $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - -``` - -Keep in mind that including PDBs in the .nupkg increases the size of the package and thus restore time for projects that consume your package, regardless of whether the user needs to debug through the source code of your library or not. - .snupkg symbol packages have following limitations: - They do not support Windows PDBs (generated by VC++, or for managed projects that set build property `DebugType` to `full`) @@ -225,8 +215,29 @@ Keep in mind that including PDBs in the .nupkg increases the size of the package - The consumer of the package also needs Visual Studio 2017 Update 9 debugger. - Not supported by [Azure DevOps Artifacts](https://azure.microsoft.com/en-us/services/devops/artifacts) service. -Consider including PDBs in the main package if it is not possible to use .snupkg for the above reasons. -For managed projects, consider switching to Portable PDBs by setting `DebugType` property to `portable`. This is the default for .NET SDK projects, but not classic .NET projects. +If a .snupkg does not work for your scenario, consider including debug information in the main package. + +> [!IMPORTANT] +> Keep in mind that including debug information in the .nupkg increases the size of the package and thus restore time for projects that consume your package, regardless of whether the user needs to debug the source code of your library or not. + +The simplest way to include debug information is to embed Portable PDBs directly in the assembly by setting the following property in your project: + +```xml + + embedded + +``` + +Alternatively, you can include PDB files in the main NuGet package by setting the following property in your project: + +```xml + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + +``` + +> [!TIP] +> Classic .NET projects should also consider changing the `DebugType` property to `portable` (or `embedded`) to match .NET SDK projects. ## Builds