C
C#2w ago
FoxFireX

SourceLink with private, authentication-required repo

Been trying to get this to work off and on for many months at this point, so hoping I'm missing something. We've got a number of new NuGet packages on a privately-hosted BitBucket server. They're configured with SourceLink support. When using Resharper, we can navigate into the source code of the packages after providing user credentials as shown. However, Visual Studio's native SourceLink integration doesn't seem to be able to comprehend the authentication portion of it. Whether I'm using the Git Credential Manager fallback or not, any attempt to debug into the same packages fails with a "Source Link authentication failed" error. There's an Authenticate button on the error screen, but it does nothing (i.e. the button can be clicked, but there's no popup or other control displayed). I'm running out of things to try, and really need this to work to meet our developers' needs. Git credentials are stored in the Windows Credential Manager, and work properly in git natively. Interestingly, if I try to open the SourceLink URL in the error through a Windows File Open dialog, it presents a Windows Security popup that allows me to enter credentials, but my domain credentials (used for normal BitBucket access) are never accepted, no matter which variant I try. Opening the same URL in a browser immediately downloads the file, as I've logged into BitBucket via the browser and therefore have appropriate session cookies in place. Anyone got any other ideas on what I might be missing, or whether this is actually possible?
No description
No description
2 Replies
canton7
canton72w ago
If the nuget packages are only made available internally, you could always ditch the pain in the ass that sourcelink is, and use snuget packages / just bundle the source directly into the pdb (I've run into so many problems with sourcelink, but snuget just works, and bundling the source into the pdb is even easier, as everything's there in the one package. The downside is that it makes the package download larger, but if everything's private and local you probably don't care about that) Sourcelink makes sense for large projects like .NET where you really don't want to be downloading the whole codebase to just debug one file, but for small stuff the other options work just fine
FoxFireX
FoxFireXOP2w ago
Not necessarily internal only. I'd have to discuss whether it would be okay to distribute the code more widely. Although I suppose I could be tricky and have internal developers pull from a different nuget repo that includes source, and build servers pull from one that doesn't... I don't like that you're not building the exact same thing then, but maybe it would work...

Did you find this page helpful?