ctaggart / SourceLink

Source Code On Demand
MIT License
356 stars 55 forks source link

GIT private repo still not working #364

Closed StefanKoenen closed 5 years ago

StefanKoenen commented 6 years ago

@ctaggart I just saw your message here: https://github.com/ctaggart/SourceLink/issues/204 My code is at gitlab.com (private repo) and the authentication is still not working. I've added my git credentials to the credential manager (also tried to do this with source tree) but its still not working (sourcelink test still gives "url hash does not match")

It should work right? Am I doing something wrong, or is it possible to create some documentation for this?

rgl commented 6 years ago

I think gitlab.com does not support basic authentication, just try to capture the https traffic with fiddler to see what is going on. For GitLab hosted locally, I had to hack the GitLab server to make this work though...

mateoeoeo commented 6 years ago

@ctaggart I also can confirm that in VS 2017 15.9.0 Preview 1.0 I cannot get SourceLink working with local TFS instance. VS properly attempts to get the source from valid url, but I get 401 unauthorized error.

Locating source for 'C:\Projects\example-dotnet-source-link\ExampleLibrary\Greeter.cs'. Checksum: SHA1 {9e 8d f 3d 69 e7 e6 bb 71 47 81 6c af 61 e f4 4a 19 c0 7e}

The file 'C:\Projects\example-dotnet-source-link\ExampleLibrary\Greeter.cs' does not exist.

Looking in script documents for 'C:\Projects\example-dotnet-source-link\ExampleLibrary\Greeter.cs'...

Looking in the Edit-and-Continue directory 'C:\Projects\example-dotnet-source-link\ExampleApplication\enc_temp_folder\'...

The file with the matching checksum was not found in the Edit-and-Continue directory.

Looking in the projects for 'C:\Projects\example-dotnet-source-link\ExampleLibrary\Greeter.cs'.

The file was not found in a project.

Searching for documents embedded in the symbol file.

An embedded document was not found.

Looking for source using Source Link (http://XXXXXXXX:8080/tfs/YYYYYY/ZZZZZZ/_apis/git/repositories/example-dotnet-source-link/items?api-version=1.0&versionType=commit&version=f248c5eab441efb76730b0f755be3ffc5a67a131&path=/ExampleLibrary/Greeter.cs)...

Source Link errors:

ERROR: The request failed with code 401 : "Unauthorized".

The file was not found with Source Link.

The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: C:\Projects\example-dotnet-source-link\ExampleLibrary\Greeter.cs.

The debugger could not locate the source file 'C:\Projects\example-dotnet-source-link\ExampleLibrary\Greeter.cs'.
ctaggart commented 5 years ago

@mateoeoeo Can you try again. I was able to get it working with 15.8.3 with GitHub Enterprise. I put my notes in https://github.com/dotnet/sourcelink/issues/148#issuecomment-423344486

When you get the unauthorized message, do you get a link like I got?

The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: C:\Projects\example-dotnet-source-link\ExampleLibrary\Greeter.cs.

That message means you need to clear out some solution properties. I documented that on the wiki: https://github.com/ctaggart/SourceLink/wiki/Visual-Studio

mateoeoeo commented 5 years ago

@ctaggart I've tried again on 15.8.5 with the same result. I also installed latest version of git for Windows. But the result is still the same.

I've cleared the solution properties you mentioned. In this situation, during debugging I'm asked to give the location of the file on disk. When I point to the file on disk, no attempt to retrieve sources via sourcelink is made, only the file from drive is opened.

Do I need to make any GCM-related configuration maybe?

ctaggart commented 5 years ago

@rgl, GitLab support is here https://github.com/dotnet/sourcelink/issues/42

Others, please use https://github.com/dotnet for private repository support.