SourceLink generating incorrect URLs when configured with GitHub Enterprise URL
See original GitHub issueI have a repository hosted on an internal GitHub Enterprise server. I’ve configured a .NET 5 solution to use Source Link by referencing the Microsoft.SourceLink.GitHub
package version 1.0.0
. I’ve also manually configured all the properties required for reproducible builds (I am not using DotNet.ReproducibleBuilds
). The <RepositoryUrl>
property is set to https://internal.ghe/org/project.git
(redacted).
According to NuGet Package Manager, my package was generated properly:
However, the URLs to each source file that are stored within my library’s PDB cause a 404 when I try to navigate to them:
I am not sure what the correct URL should be, nor what the GUID in the URL represents. However, when I go to a file in the GHE UI and click the Raw button, the domain changes to raw.internal.ghe
. I suspect the URL generation algorithm SourceLink uses needs to be tweaked.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
@tmat The MSBuild property worked as far as generating the correct beginning. I still get a 404 when I try and access the URL, but apparently this is because in GHE, at least with my organization’s identity provider configuration, a
?token=...
query string is appended when viewing a raw file. Obviously the NuGet package has no way of knowing what this token should be set to.Hopefully when SourceLink is actually used from within Visual Studio (if it’s used) the token will be appended correctly based on stored credentials or some other mechanism. Otherwise, SourceLink with GHE seems to be useless.
@nathan-alden-hp
Could you try adding the following XML to your project?