SourceLink

SourceLink is a technology that enables source code debugging of .NET assemblies from NuGet by developers. SourceLink executes when creating the NuGet package and embeds source control metadata inside assemblies and the package. Developers who download the package and have SourceLink enabled in Visual Studio can step into its source code. SourceLink provides source control metadata to create a great debugging experience.

Instructions for using SourceLink can be found on the dotnet/sourceLink GitHub repository.

You can use NuGet Package Explorer to confirm that the SourceLink metadata has been successfully embedded in the package. Check the Repository metadata is present with a comment identifier and that .pdb files are located with each target's .dll.

SourceLink in NuGet Package Explorer

✔️ CONSIDER using SourceLink to add source control metadata to your assemblies and NuGet packages.

Tip

You can further enhance a developer's debugging experience by adding debugger attributes to your types.

✔️ CONSIDER publishing symbol files (*.pdb).

For more information about symbol files and symbol packages, see Symbol packages.