From 3f583decc551b5c0460d7f5cbb5787391f59d14b Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Tue, 20 Nov 2018 15:55:24 +1300 Subject: [PATCH] Update symbol packages guidance (#9110) --- docs/standard/library-guidance/nuget.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/standard/library-guidance/nuget.md b/docs/standard/library-guidance/nuget.md index a53aac87a169e..208f987f0e962 100644 --- a/docs/standard/library-guidance/nuget.md +++ b/docs/standard/library-guidance/nuget.md @@ -90,9 +90,14 @@ NuGet packages with a version suffix are considered [pre-release](/nuget/create- ## Symbol packages -Symbol files (`*.pdb`) are produced by the .NET compiler alongside assemblies. Symbol files map execution locations to the original source code so you can step through source code as it is running using a debugger. NuGet supports [generating a separate symbol package](/nuget/create-packages/symbol-packages) containing symbol files alongside the main package containing .NET assemblies. The idea of symbol packages is they're hosted on a symbol server and are only downloaded by a tool like Visual Studio on demand. +Symbol files (`*.pdb`) are produced by the .NET compiler alongside assemblies. Symbol files map execution locations to the original source code so you can step through source code as it is running using a debugger. NuGet supports [generating a separate symbol package (`*.snupkg`)](/nuget/create-packages/symbol-packages-snupkg) containing symbol files alongside the main package containing .NET assemblies. The idea of symbol packages is they're hosted on a symbol server and are only downloaded by a tool like Visual Studio on demand. -Currently the main public host for symbols - [SymbolSource](http://www.symbolsource.org/) - doesn't support the new [portable symbol files](https://github.com/dotnet/core/blob/master/Documentation/diagnostics/portable_pdb.md) (`*.pdb`) created by SDK-style projects, and symbol packages aren't useful. Until there is a recommended host for symbol packages, symbol files can be embedded in the main NuGet package. If you are building your NuGet package using an SDK-style project you can embed symbol files by setting the `AllowedOutputExtensionsInPackageBuildOutputFolder` property: +NuGet.org hosts its own [symbols server repository](/nuget/create-packages/symbol-packages-snupkg#nugetorg-symbol-server). Developers can use the symbols published to the NuGet.org symbol server by adding `https://symbols.nuget.org/download/symbols` to their [symbol sources in Visual Studio](/visualstudio/debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger). + +> [!IMPORTANT] +> The NuGet.org symbol server only supports the new [portable symbol files](https://github.com/dotnet/core/blob/master/Documentation/diagnostics/portable_pdb.md) (`*.pdb`) created by SDK-style projects. + +An alternative to creating a symbol package is embedding symbol files in the main NuGet package. The main NuGet package will be larger, but the embedded symbol files means developers don't need to configure the NuGet.org symbol server. If you're building your NuGet package using an SDK-style project, then you can embed symbol files by setting the `AllowedOutputExtensionsInPackageBuildOutputFolder` property: ```xml @@ -105,7 +110,9 @@ Currently the main public host for symbols - [SymbolSource](http://www.symbolsou **✔️ CONSIDER** embedding symbol files in the main NuGet package. -**❌ AVOID** creating a symbols package containing symbol files. +> Embedding symbol files in the main NuGet package gives developers a better debugging experience by default. They don't need to find and configure the NuGet symbol server in their IDE to get symbol files. +> +> The downside to embedded symbol files is they increase the package size by about 30% for .NET libraries compiled using SDK-style projects. If package size is a concern, you should publish symbols in a symbol package instead. >[!div class="step-by-step"] [Previous](./strong-naming.md)