1

I have two solutions that are libraries to my other projects

First one is called the framework and the second one is the library. some projects on the solution are .net standard 2.1 and some are .net core 3.1

each solution is in a different git repository, but I have full access to both.

this is my project configuration

I have two builds on azure devops that should be identical. Both of them build, publish the nuget packages and the symbols to the same azure devops.

In visual studio I added the azure devops as symbol location.

all of the symbols from both projects are loaded in the cache, but only the source link from the library works, the symbol from the framework gives me these error

You need to find StartUpExtensions.cs to view the source for the current call stack frame

Source Link Error: Azure DevOps: Using credentials for account "luiz.bicalho@XXXXXXXXX.com.br". ERROR: The request failed with code 404 : "Not Found". Treating 404 as authentication failure. Some services return 404 instead of 401 for authentication failures.

Source Link URL: https://XXXXXXXX.visualstudio.com/828fa95b-4dc5-4f4a-b335-a9f82be0d6d5/_apis/git/repositories/c625311f-9b29-48c5-af18-c36be4b662df/items?api_version=1.0&versionType=commit&version=b8d8dc10f07a92cc304f027ae89f928c85bcfa1f&path=/Framework/XXXXXXXXXXX/StartUp/StartUpExtensions.cs

Locating source for 'C:\agent_work\10\s\Framework\XXXXXXXXX\StartUp\StartUpExtensions.cs'. Checksum: SHA256 {64 99 71 5c 2b 61 7b 3a c4 1a e5 56 a8 d4 7c 4c 66 27 15 91 50 bf 61 f5 f5 bc 2c 60 76 cc 5b dc} The file 'C:\agent_work\10\s\Framework\XXXXXXXXX\StartUp\StartUpExtensions.cs' does not exist. Looking in script documents for 'C:\agent_work\10\s\Framework\XXXXXXXXX\StartUp\StartUpExtensions.cs'... Looking in the projects for 'C:\agent_work\10\s\Framework\XXXXXXXXX\StartUp\StartUpExtensions.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 (https://XXXXXXX.visualstudio.com/828fa95b-4dc5-4f4a-b335-a9f82be0d6d5/_apis/git/repositories/c625311f-9b29-48c5-af18-c36be4b662df/items?api_version=1.0&versionType=commit&version=b8d8dc10f07a92cc304f027ae89f928c85bcfa1f&path=/Framework/XXXXXXXXXXXX/StartUp/StartUpExtensions.cs)... Source Link errors: Azure DevOps: Using credentials for account "luiz.bicalho@XXXXXXXXXX.com.br". ERROR: The request failed with code 404 : "Not Found". Treating 404 as authentication failure. Some services return 404 instead of 401 for authentication failures. The file was not found with Source Link. Looking for source using source server... The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: C:\agent_work\10\s\Framework\XXXXXXXXXX\StartUp\StartUpExtensions.cs. The debugger could not locate the source file 'C:\agent_work\10\s\Framework\XXXXXXXXX\StartUp\StartUpExtensions.cs'.

I'm not sure what is causing this error, I looked up in git security, in the build process, and in the project configuration

I'll add some more information to complete the answer from Lance Li-MSFT

1) the first configuration

2) That's the deploy that works library deploy

And that's the deploy that doesn't work enter image description here

3) I have two differences here

a) Just my code was enabled b) .net framework source stepping was disabled

4) i'm doing that right now

Still not working, and my account is not azure AD account, is a live Id in azure devops

Luiz Bicalho
  • 813
  • 1
  • 12
  • 30

2 Answers2

1

I can't reproduce same issue on my side, however I can confirm the source link should work well if all settings are set well (I tested with .net core library just now and it worked).

You can try my tips below to do a trouble-shooting and resolve that issue:

  1. Make sure the project StartUpExtensions.cs belongs to has DebugType=Full. According to your pic, you've set that well. But I'm not sure if you set all your projects in this way.

  2. In Azure Devops pipeline, follow my settings here to configure the Publish Symbol path task.

  3. In VS, navigate to Debug=>Options and enable options like below:

    enter image description here

  4. In VS, remove and re-add the Azure Devops Service server:

    enter image description here

Rebuild the project and debug it again to check if it helps. If the issue doesn't go away, you need to check if the account you're using is Azure AD account. You may need to use a typical devops account or add the AD account to Azure devops. Similar to this issue.

Hope it helps :)

LoLance
  • 25,666
  • 1
  • 39
  • 73
  • Thank's, I did all the possible changes, put in my questions all of the information and I still can't get the source link to , the symbol was downloaded correctly to my symbol cache today, but not the source – Luiz Bicalho May 19 '20 at 16:13
  • 1
    You woudn't believe in the problem that resulted in this issue, in the git repo I had two folders with the same name, but different casing, one was XX.webapi.extensions and the other was XX.WebApi.Extensions, and somehow the source link was not working, where can I find the minimum git priviledges that a user need to se the source link? – Luiz Bicalho May 19 '20 at 17:27
  • 1
    Hmm, this is a strange scenario that i haven't met before. Does the two folders under same repo both contain the source code? What if you temporarily rename one folder's name, the original issue disappears? – LoLance May 20 '20 at 09:23
  • One had just the csproj file and the other had all the source, then I removed one folder and everything worked fine after that – Luiz Bicalho May 20 '20 at 12:24
  • In azure devops what's the minimum group that the user needs to see the source? just Readers is enough ? – Luiz Bicalho May 20 '20 at 12:43
  • If you're saying `see`, then the readers is enough. If you want the user to have the access to create branch/tag or what, then contributors can be ok. More details you can check [this document](https://learn.microsoft.com/en-us/azure/devops/organizations/security/permissions-access?view=azure-devops#azure-repos). – LoLance May 21 '20 at 07:37
  • @LuizBicalho And since this issue is resolved by removing the folder, do you mind adding that as answer and mark it, so that more members with similar issue can get useful info from that :) – LoLance May 21 '20 at 07:39
1

That's a strange scenario here, in GIT there were two folders with the same name , but different case. one was XX.webapi.extensions and the other was XX.WebApi.Extensions, one had only de .csproj and the other had all the files, but probably sourcelink looked in the first and didn't find the file.

Solved when I deleted one of the folders.

Luiz Bicalho
  • 813
  • 1
  • 12
  • 30