question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SourceLink does not work for strongly typed resources file (SR.cs)

See original GitHub issue

SourceLink obviously can’t link to generated files - and indeed it doesn’t.

c:\pdb>dotnet install sourcelink
...
c:\pdb>sourcelink test System.Private.CoreLib.pdb
2 Documents with errors:
4f669fa1207b58d3b39ddff04669a5b70d4e3d347d8050812be67735e76b76b0 sha256 csharp /__w/8/s/bin/obj/Linux.x64.Release/System.Private.CoreLib/SR.cs
https://raw.githubusercontent.com/dotnet/coreclr/b9e88989458e24fa9764e045917b141e3338eae7/bin/obj/Linux.x64.Release/System.Private.CoreLib/SR.cs
error: url failed NotFound: Not Found
da711da20befe335e16ebe6ddff69f2ccd87b2627d4f7ef271a234d9dad1faac sha256 csharp /__w/8/s/bin/obj/Linux.x64.Release/eventing/DotNETRuntimeEventSource.cs
https://raw.githubusercontent.com/dotnet/coreclr/b9e88989458e24fa9764e045917b141e3338eae7/bin/obj/Linux.x64.Release/eventing/DotNETRuntimeEventSource.cs
error: url failed NotFound: Not Found
sourcelink test failed

c:\pdb>sourcelink test System.Collections.Specialized.pdb
1 Documents with errors:
48b0076adc624decfc86b8871b5ba2c79c39228f09da4ad293b1a4eb7d7409e3 sha256 csharp /Users/vsts/agent/2.144.2/work/1/s/artifacts/obj/System.Collections.Specialized/netcoreapp-AnyOS-Release/System.SR.cs
https://raw.githubusercontent.com/dotnet/corefx/351ca391579740ae8af8a5405cffa16d152ad6b2/artifacts/obj/System.Collections.Specialized/netcoreapp-AnyOS-Release/System.SR.cs
error: url failed NotFound: Not Found
sourcelink test failed

This is fine and inevitable but is forever going to be noise when we validate sourcelink in our PDB’s.

Not a big deal but @tmat is there (eg) some flag we should pass to embed into the PDB somehow the knowledge that sourcelink will not work for SR.cs, that would suppress such errors?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Anipikcommented, Apr 12, 2019

@tmat Setting this property EmbedUntrackedSources to true solves our problem and doesnot slow down significantly. I was wondering if there is a way to only embed untracked files in specific directory ? eg untracked files in only the artifacts folder. I am just worried that people may be able to use it to add non-generated files as well and we wont be able to detect the sourcelink failure

cc @ericstj

0reactions
Anipikcommented, Apr 12, 2019

talked with @ericstj offline. Your comment addresses most of his concerns. Thanks I will put up the PR to address it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does SourceLink not work for embedded pdb files? #798
Yes, it should work as long as each of the packages is built with Source Link. Each assembly (.dll/.exe) has its own Source...
Read more >
Link /SOURCELINK option seems to do nothing
We are using SourceLink with c# projects and it is working just fine. When we try to use it on C++ projects the...
Read more >
c# - Enabling SourceLink
Most of the tutorials on how to set up SourceLink seem to omit two key things. Firstly: As well as unchecking "Enable Just...
Read more >
Improving Debug-time Productivity with Source Link - .NET ...
Learn how to improve your debug-time productivity by using Soure Link to step into framework and dependency code with .NET.
Read more >
How to Configure Visual Studio to Use SourceLink to Step into ...
By default SourceLink support is already enabled in Visual Studio, but source server support is not. Again, go to the Tools –> Options...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found