vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Debugger should support authentication with symbol server and source link

Open gregg-miskelly opened this issue 7 years ago • 21 comments

In 1.15, the debugger added support for Source Link and Symbol Server. However, it currently doesn't support either symbol servers or source link endpoints that require authentication.

This feature request tracks adding support for either or both of these. My guess is that we would want to do both at the same time, but I could be wrong.

Workaround

Manually clone the repo/source repository and add a sourceFileMap entry to your launch.json.

gregg-miskelly avatar Feb 26 '18 21:02 gregg-miskelly

Hey Guys,

I presume this is an issue for private Azure Dev Ops repositories then as I'm getting a 401 when trying.

garfbradaz avatar Dec 21 '18 20:12 garfbradaz

Correct

gregg-miskelly avatar Dec 22 '18 00:12 gregg-miskelly

@gregg-miskelly thanks for the reply. Is there a spec for this and is it up-for-grabs?

garfbradaz avatar Dec 23 '18 13:12 garfbradaz

Is this planned out at all for a (near-)future version of VSCode? Maybe a way to provide a local fallback for such scenarios?

ransagy avatar Dec 01 '19 10:12 ransagy

@ransagy by 'local fallback' do you mean pointing at a local source file? Local source files should always take precedence over SourceLink -- you want to add a sourceFileMap to your launch.json.

We don't have a timeline for the feature currently. It is not particularly easy to do as we need some sort of cross-platform credential UI to do it right.

gregg-miskelly avatar Dec 02 '19 18:12 gregg-miskelly

Hah, missed that bit of the docs, damn. I completely understand this is nowhere near easy, Just wanted to gauge if there's any work being done towards it, so that answers both my questions. Thanks!

ransagy avatar Dec 02 '19 21:12 ransagy

@ransagy It was a good question, so thanks for asking it. I added a 'Workaround' section above to hopefully make it more obvious.

gregg-miskelly avatar Dec 02 '19 21:12 gregg-miskelly

I guess traditional VS taught me to expect that "where is your source" dialog, hence i assumed it's not implemented.

ransagy avatar Dec 02 '19 21:12 ransagy

@gregg-miskelly any news on the this one fella?

garfbradaz avatar Sep 03 '20 18:09 garfbradaz

@gregg-miskelly any chance that this will get looked at soon?

divinebovine avatar Apr 14 '21 17:04 divinebovine

Unfortunately, the status of this feature is unlikely to change anytime soon. It is not particularly easy to do as we need some sort of cross-platform credential UI to do it right. Also, the debugger team is currently fully booked on other work.

gregg-miskelly avatar Apr 14 '21 17:04 gregg-miskelly

@gregg-miskelly isn't that what the https://github.com/microsoft/Git-Credential-Manager-Core is supposed to be for?

CRuppert avatar Apr 29 '21 20:04 CRuppert

@CRuppert That might be a good option. GCM Core is one of the things we use in Visual Studio.

gregg-miskelly avatar Apr 29 '21 20:04 gregg-miskelly

@gregg-miskelly just wanted to circle back around on this issue. Is this being considered any time in the next few quarters?

divinebovine avatar Oct 14 '21 19:10 divinebovine

The debugger team doesn't currently have time booked for this. Prioritizations change often, so it is certainly possible, especially if this got enough up votes. But its not something that I can promise.

gregg-miskelly avatar Oct 15 '21 16:10 gregg-miskelly

Thanks for the reply @gregg-miskelly. I get it, it would just be a really helpful feature for organizations like mine with private repos. 😞

divinebovine avatar Oct 15 '21 16:10 divinebovine

We are waiting this improvement like 🙇‍♂️🙇🙇‍♀️

ohanedan avatar Jul 05 '23 07:07 ohanedan

please

boylec avatar Sep 13 '23 22:09 boylec

Is there a place to vote for this feature?

Also, i have been trying to use the sourceFileMap without success with vs code where debugging a dll.

Is there a way to diagnostic the problem with the source map and is there a documentation explaining with a real use case?

I read the foo example but what is the "c:\foo" in the case the dll is build on a build server does it represent the original build path?

"sourceFileMap": {
    "C:\\foo":"/home/me/foo"
}

I have tried to set some key map but keep receiving Error: Unable to Locate Source File message because of authentication issue do it's look like the map not working.


"sourceFileMap": {
                "https://api.bitbucket.org/2.0/repositories/XYX/Project/src/5040ef34b3a083b7789eaa711f03a58319c03db4/": "G:\\Git\\LOCAL\\Project\\",
                "C:\\BuildAgent\\work\\be4f9bbfc6a122ad\\*": "G:\\Git\\LOCAL\\Project\\*",
                "/_/": "G:\\Git\\LOCAL\\Project\\*",
            },
// -----------------------------------
// Error: Unable to Locate Source File
// -----------------------------------
// 
// The source file you're trying to access, located at
// '/_/src/Project/Test.cs', cannot be found on this
// computer. The debugger attempted to download the source file using Source Link, but the
// request failed.
// 
// Possible Reasons:
// * The server requires authentication, but the VS Code C# debugger doesn't support
// authentication. See: https://aka.ms/VSCode-DotNet-SourceLinkAuthNotSupported
// * The source control commit that this module was built from doesn't exist on the
// server. For example, if this module was compiled on a developer's computer, the source
// commit might have been temporary or never pushed to the server.
// 
// What to Do:
// Manually obtain source code, for example by cloning the appropriate repo locally, and
// use `sourceFileMap` to point the debugger at the source code. See
// https://aka.ms/VSCode-CS-SourceFileMap for complete instructions.
// 
// Error Details:
// The request failed with HTTP status code 404 (NotFound).
// 
// The URL where the source file will be downloaded from:
// https://api.bitbucket.org/2.0/repositories/XYX/Project/src/5040ef34b3a083b7789eaa711f03a58319c03db4/src/Project/Test.cs
// 
// For more information about Source Link and VS Code see
// https://aka.ms/VSCode-DotNet-SourceLink

jobou363 avatar Nov 01 '23 21:11 jobou363

@gregg-miskelly any update? i using github packages

etmyhome avatar Dec 01 '23 21:12 etmyhome

@gregg-miskelly Would be possible to use personal access token? This way wouldn't be needed an UI. Just add the PAT somewhere in the extension setting. (Rider uses the same approach to fetch sources from private repos)

viniciusjarina avatar Jun 24 '24 14:06 viniciusjarina

Suggestion from @viniciusjarina looks really good. And it works great in Rider. It would be very much appreciated functionality.

netijoe avatar Jul 11 '25 14:07 netijoe