You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expectation of on-prem Bitbucket with authentication working? #1404
I've been battling this off and on for a year or two at this point. I thought I had things solved, but I'm now concerned that either a recent VS update broke what I thought was working, or maybe it never was working at all. Shortest version I can manage: We have multiple internal NuGet packages hosted on an internal server. They're configured to link back to the repos using SourceLink configuration. The source control server is Bitbucket Data Center, and requires login to access the code. With just that much, I today found this comment, which makes me worry that I'm already barking up a dead tree: #788 (comment)
From the several related issues I've looked at, I'll add the following details:
There is a "Source Link Authentication Failed" landing page which provides options to "Authenticate", "Decompile", "Browse", or "View"; pressing "Authenticate" does nothing whatsoever
Request is failing with 401 Unauthorized
Fiddler using HTTPS inspection shows that the VS requests are NOT being sent with any Authorization header whatsoever
Git Credential Manager fallback is enabled
I have confirmed on the command line that using git with the same https: server prefix works as expected using its saved credentials
I will also note that we do use Resharper, and it provides its own SourceLink integration for scenarios other than debug step into; notably you can control-click on an item, and navigate to its definition through the SourceLink information. That part is working fine, so it really seems like the problem is just that I can't get VS to use any authentication information in this scenario, whether directly or via GCM.
I had seen some older posts mentioning using Web Credentials in the Windows Credential Manager, but it seems that there isn't a way to store something there other than Internet Explorer, or perhaps earlier versions of Edge. Current Edge seems to prefer a Microsoft Wallet concept.
<!-- normalize paths -->
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<!-- also include PDBs in nuget package -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
The PDB looks fine, dotnet sourcelink print-json prints:
Still it doesn't work with R# navigate to. I've cleared all the caches I know of. R# output window shows:
PdbNavigator: Searching for 'CLASS' type sources in PDBFILEPATHINNUGETCACHE
PdbNavigator: No sources found in debugging information for 'CLASS' in assembly 'ASSEMBLY'
The Navigate to External Sources output shows:
Navigating to symbol 'CLASS' from 'ASSEMBLY'.
Symbol found in assembly path DLLFILEPATHINNUGETCACHE
Found PDB file at PDBFILEPATHINNUGETCACHE
What are you doing differently so that navigate to sources works for you? In earlier R# versions I got this authenticate information thingy in the status bar, now I'm trying it with VS26 and R# 2025.3 or VS22 and R# 2025.3 and it doesn't even show the auth info thingy anymore.
@drauch Honestly, what we had working was tenuous at best, and didn't seem to reproduce across other developers. I ended up having to ditch this approach entirely. We instead pivoted to an approach where we build our NuGet packages twice, once with embedded source code and once without. Developer workstations are configured to pull from a private repo that uses the source-included packages, while our build servers are configured to pull from the publicly-available repo which has the non-source packages instead. There's some risk of shipping a source-included DLL if a developer sends out a hotfix from their local machine, but we consider that to be an acceptable risk given our customer base.
OK, thank you for your quick reply. We also can't put the source in the DLLs, unfortunately, it's a nice idea to have two versions, but that sounds like a lot of overhead as well :-(
Does anybody know by chance if this is a BitBucket-integration-specific problem and it would work great on GitHub or GitLab, or is it a general problem that sourcelink is a broken technology?
Yeah, it's not great. Fortunately for us, I was able to bundle in the "Build twice, publish twice" logic into some YAML Bamboo specs templates, so all our affected projects just inherit that same behavior. We then have developers add the source-included repo to their nuget config, and set up our build farm agents to have the no-source repo in their nuget config. It ends up not being too bad in practice, but the infrastructure setup did take a little effort to get right. It also means we can't use repository pinning for those dependencies, unless we added some extra step to swap the pin during a build process. Best of luck finding a solution for yours.
Activity
tmat commentedon Apr 8, 2025
@chuckries
drauch commentedon Nov 28, 2025
@roger-strain You say you got R# source navigation working, it doesn't unfortunately at our side.
We're also using BitBucket Server on-prem.
Is there anything special you must do?
We added the respective NuGet-Package reference:
<PackageReference Include="Microsoft.SourceLink.Bitbucket.Git" PrivateAssets="All"/>We set the following properties:
The PDB looks fine,
dotnet sourcelink print-jsonprints:(two hashes, as we have one submodule)
Still it doesn't work with R# navigate to. I've cleared all the caches I know of. R# output window shows:
The Navigate to External Sources output shows:
What are you doing differently so that navigate to sources works for you? In earlier R# versions I got this authenticate information thingy in the status bar, now I'm trying it with VS26 and R# 2025.3 or VS22 and R# 2025.3 and it doesn't even show the auth info thingy anymore.
Best regards,
D.R.
roger-strain commentedon Dec 1, 2025
@drauch Honestly, what we had working was tenuous at best, and didn't seem to reproduce across other developers. I ended up having to ditch this approach entirely. We instead pivoted to an approach where we build our NuGet packages twice, once with embedded source code and once without. Developer workstations are configured to pull from a private repo that uses the source-included packages, while our build servers are configured to pull from the publicly-available repo which has the non-source packages instead. There's some risk of shipping a source-included DLL if a developer sends out a hotfix from their local machine, but we consider that to be an acceptable risk given our customer base.
drauch commentedon Dec 2, 2025
OK, thank you for your quick reply. We also can't put the source in the DLLs, unfortunately, it's a nice idea to have two versions, but that sounds like a lot of overhead as well :-(
Does anybody know by chance if this is a BitBucket-integration-specific problem and it would work great on GitHub or GitLab, or is it a general problem that sourcelink is a broken technology?
Best regards,
D.R.
roger-strain commentedon Dec 2, 2025
Yeah, it's not great. Fortunately for us, I was able to bundle in the "Build twice, publish twice" logic into some YAML Bamboo specs templates, so all our affected projects just inherit that same behavior. We then have developers add the source-included repo to their nuget config, and set up our build farm agents to have the no-source repo in their nuget config. It ends up not being too bad in practice, but the infrastructure setup did take a little effort to get right. It also means we can't use repository pinning for those dependencies, unless we added some extra step to swap the pin during a build process. Best of luck finding a solution for yours.