© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
3 replies
rick_o_max

❔ Generator setting wrong (not existing) source path in the PDB file

Hi!
I'm generating some classes with a custom generator (Roslyn).
When the PDB file is generated, the path to the generated document is wrong, making impossible to debug it.
In the PDB file, the path to the generated source is relative to the generator project, and not to the project that is consuming the generator:
  <Document Index="8" DocumentType="Text" Language="C#" LanguageVendor="Microsoft" ChecksumAlgorithm="SHA-1" Checksum="2d 0c 35 89 df cf b0 cf 65 1b a6 52 70 b7 94 c4 6e 29 7c cc ">C:\Repos\trilib-core\TriLibCore.Obj\TriLibCore.Generators\TriLibCore.Generators.CoroutineGenerator\CoroutineGenerated.cs</Document>
  <Document Index="8" DocumentType="Text" Language="C#" LanguageVendor="Microsoft" ChecksumAlgorithm="SHA-1" Checksum="2d 0c 35 89 df cf b0 cf 65 1b a6 52 70 b7 94 c4 6e 29 7c cc ">C:\Repos\trilib-core\TriLibCore.Obj\TriLibCore.Generators\TriLibCore.Generators.CoroutineGenerator\CoroutineGenerated.cs</Document>

Also, this file doesn't seem to exist.
Enabling the
EmitCompilerGeneratedFiles
EmitCompilerGeneratedFiles
project option and setting the path manually will generate the file inside the current project path, and not the generator project path. Also, changing the
CompilerGeneratedFilesOutputPath
CompilerGeneratedFilesOutputPath
does not change the PDB document path.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Source generator not working?
C#CC# / help
12mo ago
source generator
C#CC# / help
3y ago
❔ Read a .pdb file in C#
C#CC# / help
3y ago
❔ Access AdditionalFiles in source generator
C#CC# / help
3y ago