Source Link

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

Instructions for using Source Link can be found on the dotnet/sourcelink GitHub repository.

You can use NuGet Package Explorer to confirm that the Source Link 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.

Source Link in NuGet Package Explorer

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


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

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

For the best debugging experience your library should publish symbol files as well as use Source Link. For more information about symbol files and symbol packages, see Symbol packages.