5

I am using Visual Studio 15.8.4 referencing a NuGet package from a private MyGet feed. The source code is hosted by a private repo at GitHub.

I can successfully print the mapping document in the file:

sourcelink print-json C:\Users\Foo\.nuget\packages\My.Package\1.1.0-beta-0040\lib\netstandard2.0\My.Package.dll
{"documents":{"C:\\projects\\my-package\\*":"https://raw.githubusercontent.com/username/My.Package/aba3ab5d12f1271943b8db0d79e1ee25ad4735c2f/*"}}

I have unchecked Enable Just My Code in Visual Studio, and I have checked Enable Source Link support and Fall back to Git Credential Manager authentication for all Source Link requests.

But when I debug, the debugger won't step into the package. I would expect the dialog about "source link will be downloaded from the internet" to show, but nothing happens. The debugger just steps over the line of code.

Since the document path is correct, expect for the missing token key in the URI, I draw the conclusion that the NuGet package itself has been packed correctly, thus I don't give any details about that process.

The files are not downloadable, but that is due to the authentication not taking place, isn't it?

sourcelink test C:\Users\Foo\.nuget\packages\My.Package\1.1.0-beta-0040\lib\netstandard2.0\My.Package.dll
{"documents":{"C:\\projects\\my-package\\*":"https://raw.githubusercontent.com/username/My.Package/aba3ab5d12f1271943b8db0d79e1ee25ad4735c2f/*"}}

2 Documents with errors:
111111111117629326ff4b1b85b15fad279137fe sha1 csharp C:\projects\my-package\src\My.Package\Extensions.cs
https://raw.githubusercontent.com/username/My.Package/11111111111095e33b8db0d79e1ee25ad4735c2f/src/My.Package/Extensions.cs
error: url failed NotFound: Not Found
1111111111184ac4af0122bdae9216bd24036e8f sha1 csharp C:\projects\my-package\src\My.Package\MyProgram.cs
https://raw.githubusercontent.com/username/My.Package/11111111111095e33b8db0d79e1ee25ad4735c2f/src/My.Package/MyProgram.cs
error: url failed NotFound: Not Found
sourcelink test failed

Am I missing any configuration here?

Kristoffer Jälén
  • 4,112
  • 3
  • 30
  • 54
  • 1
    You can pass a username and password to `sourcelink test`. That is a separate tool that I wrote. The Visual Studio debugger supports falling back to Git Credential Manager, but `sourcelink test` does not. Note for github, you can use a token as the username. – Cameron Taggart Sep 12 '18 at 14:29
  • 1
    I would open up Debug > Windows > Modules while on a breakpoint and make sure symbol is loaded. – Cameron Taggart Sep 12 '18 at 14:37
  • 2
    In the recent blog from Carlos Mendible https://github.com/ctaggart/SourceLink/wiki/Blog-Posts, he suggested turning on `Suppress JIT optimization on module load`. – Cameron Taggart Sep 12 '18 at 14:40
  • 1
    Just in case, I would go to the solution properties and make sure `Do not look for these files` is empty as described at https://github.com/ctaggart/SourceLink/wiki/Visual-Studio – Cameron Taggart Sep 12 '18 at 14:44
  • 2
    Thanks, I've checked your suggestions. However, after investigation, I noticed that I could step into an **synchronous** method, but not into an **asynchronous** method. That lead me to https://github.com/ctaggart/SourceLink/issues/227 and then I packed the project in Debug mode. And then I was able to step into the asynchronous method as well. I'm quite confused about how to do it correctly though. – Kristoffer Jälén Sep 13 '18 at 12:59
  • Just to confirm, you tried `Suppress JIT optimization on module load` in Release mode and you were unable to step into it? – Cameron Taggart Sep 13 '18 at 17:58
  • Yes, correct, I did. – Kristoffer Jälén Sep 13 '18 at 18:41

0 Answers0