-
Notifications
You must be signed in to change notification settings - Fork 55
Home
Please see the readme first.
SourceLink version 2 is much different than version 1, but with the same goal. Please update to version 2. It is cross platform and much smaller thanks to the Portable PDB format.
Here is the General, Debugging, Options Dialog Box from Visual Studio 2017:
SourceLink v1 automates source indexing of Windows PDB files. It enables the source code repostiory to be the source server by updating the Windows PDB files with a source index of https links. Source indexing is done by modifying the Windows PDB file after a compile.
SourceLink v2 helps enable source link support using the Portable PDB format. They are cross platform and several times smaller than Windows PDB files. The implementation and specification are open source. Source link support has documentation and is in the Portable PDB spec. The source link JSON file is built before the compile and the .NET compilers embeds it in the Portable PDB file. The compilers shipped with Visual Studio 2017 and with the DotNet SDKs support the /sourcelink
option. Here is the relevant help from the C# compiler:
. "C:\Program Files\dotnet\sdk\1.0.0\Roslyn\RunCsc.cmd" /?
/debug:{full|pdbonly|portable|embedded}
Specify debugging type ('full' is default,
'portable' is a cross-platform format,
'embedded' is a cross-platform format embedded into
the target .dll or .exe)
/embed Embed all source files in the PDB.
/embed:<file list> Embed specific files in the PDB
/sourcelink:<file> Source link info to embed into Portable PDB.
- Version 1 is documented on the SourceLink v1 page.
- The covers
SourceLink.Fake
that has been downloaded over 140,000 times as of 2017-02. - It also covers
SourceLink.exe
, the other way that v1 was distributed via Chocolatey.
- The covers
- The Visual Studio page covers source linking support in Visual Studio.
- For the history of SourceLink, take a look at Release Notes and Blog Posts.
- Contributing covers how you can help.
By default SourceLink.Create.CommandLine
will try to process GitHub and BitBucket cloned repositories. You can specify a specific server type by setting the SourceLinkServerType
MSBuild property like /p:SourceLinkServerType=GitHub
, /p:SourceLinkServerType=BitBucket
, /p:SourceLinkServerType=BitBucketServer
or /p:SourceLinkServerType=GitLab
.
You can control when it runs by setting the MSBuild property /p:SourceLinkCreate=true
. That property is set to true
by default on build servers that set CI
or BUILD_NUMBER
environment variables. In general these tools are meant to be run only on build servers.
For support, please add an issue on GitHub or with the sourcelink tag on StackOverflow. If you want to tweet how much you love this project, please do mention @cmr0n.