Version Used:
All Versions (and all VS versions)
Steps to Reproduce:
- Create a Source Generator that emits relative paths using a #line directive.
- Enable outputting generated files (set
EmitCompilerGeneratedFiles to true).
- Using Source Generators as the primary build and also use the generated files as a fall-back.
Diagnostic Id:
n/a
Expected Behavior:
Relative paths should be supported and well defined to avoid leaking full path information to SourceLink. Full paths are generally unhelpful and just leak private information.
Actual Behavior:
The documentation here provides no guidance on relative paths:
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/preprocessor-directives#error-and-warning-information
It's unclear how to get VS and CSC to agree on what relative paths mean. They currently don't agree depending on whether you are running from command line or from VS. Double-click to navigate to error behavior seems to be inconsistent between versions of Visual Studio.