Search code examples
c#gitazure-devopsvisual-studio-2019sourcelink

File not found: Source link authentication failed


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 "[email protected]". 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 "[email protected]". 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


Solution

  • 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.