diff --git a/README.md b/README.md index 7b099171..077d8fca 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ You can enable Source Link experience in your own .NET project by setting a few ``` -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. +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, you can [include the symbols in the main package](#alternative-pdb-distribution). However, doing so is not recommended as it increases the size of the package and thus restore time for projects that consume your package. Source Link packages are currently available for the following source control providers. @@ -142,6 +142,25 @@ The VC++ linker supports `/SOURCELINK` [switch](https://docs.microsoft.com/en-us - Various build issues on Mono: https://github.com/dotnet/sourcelink/issues/155 - Issues with WPF projects when building with `/p:ContinuousIntegrationBuild=true`: https://github.com/dotnet/sourcelink/issues/91 +## Alternative PDB distribution + +Prior availability of [NuGet.org symbol server](https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg#nugetorg-symbol-server) the recommendation used to be to include the PDB in the main NuGet package by setting the following property in your project: + +```xml + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb` + +``` + +Including PDBs in the .nupkg is generally no longer recommended as it 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. That said, .snupkg symbol packages have some limitations: + +- They do not currently support Windows PDBs (generated by VC++, or for managed projects that set build property `DebugType` to `full`) +- They require the library to be built by newer C#/VB compiler (Visual Studio 2017 Update 9). +- The consumer of the package also needs Visual Studio 2017 Update 9 debugger. + +Consider including PDBs in the main package only 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 on .NET SDK projects, but not classic .NET projects. + ## Builds Pre-release builds are available on MyGet gallery: https://dotnet.myget.org/Gallery/sourcelink.