C
C#2y 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>
<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.
2 Replies
rick_o_max
rick_o_maxOP2y ago
The path is also wrong in the Type entries, inside the PDB file:
<Type Name="TriLibCore.Obj.ObjProcessor+&lt;ProcessMaterialLibrary_Coroutine&gt;d__74">
<File>C:\Repos\trilib-core\TriLibCore.Obj\TriLibCore.Generators\TriLibCore.Generators.CoroutineGenerator\CoroutineGenerated.cs</File>
</Type>
<Type Name="TriLibCore.Obj.ObjProcessor+&lt;ProcessMaterialLibrary_Coroutine&gt;d__74">
<File>C:\Repos\trilib-core\TriLibCore.Obj\TriLibCore.Generators\TriLibCore.Generators.CoroutineGenerator\CoroutineGenerated.cs</File>
</Type>
I'm opening the PDB contents inside DotPeek.
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server