Generate real source links for the built assemblies - #1978
Merged
Conversation
The SDK supplies Microsoft.SourceLink.Common and the git tasks, so the build
resolved the repository URL and commit but had no host provider to turn them
into fetchable URLs. Every project warned that the generated source link was
empty - 477 times in the last validate run - and shipped PDBs that could not
locate their sources.
Referencing the GitHub provider, as AudibleApi already does, fills the map in:
{"documents":{"/repo/*":"https://raw.githubusercontent.com/rmcrackan/libation/<sha>/*"}}
Co-authored-by: rmcrackan <rmcrackan@gmail.com>
rmcrackan
marked this pull request as ready for review
August 19, 2026 19:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
Microsoft.SourceLink.GitHub10.0.301 toDirectory.Build.props, so it applies to everyproject. One file, eight lines.
Why
Every build emitted, once per project:
477 times in the last
validaterun.SourceLink's job is to embed a map in the PDB from each compiled source path to a URL where that
exact revision can be fetched, which is what lets a debugger pull matching sources for a built
binary. The warning means that map came out empty, so the PDBs shipped without it.
The repository was never the problem. The build resolves the URL and commit fine:
SourceLinkUrlwas blank because no SourceLink host provider was referenced anywhere in therepo. The SDK supplies
Microsoft.SourceLink.Common- which is what emits the warning - along withthe git tasks that find the repository, but nothing translated a
github.comremote intoraw.githubusercontent.comURLs.AudibleApibuilds warning-free precisely because it referencesthis provider explicitly, so this brings Libation in line.
Verification
The generated map is now populated:
{"documents":{"/agent/repos/libation/*":"https://raw.githubusercontent.com/rmcrackan/libation/63dc8fc.../*"}}LibationAvalonia,LibationCliandLibationWinForms: 0 errors, and zero occurrences of the warning.dotnet testfromSource/: 1479 total, 0 failed, 23 skipped - unchanged.PrivateAssets="All"keeps it out of anything downstream; it only affects the build.