C#C
C#3y ago
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>

Also, this file doesn't seem to exist.
Enabling the 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 does not change the PDB document path.
Was this page helpful?