Skip to content

Commit 74ab125

Browse files
authored
docs: add troubleshooting section for CSC warning CS8785 stack trace (#2137)
1 parent 4b4a23f commit 74ab125

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

docs/docs/contributing/debugging.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,14 @@ You can use the `DefineConstants` dotnet build or csproj parameter to define the
3636
For the debugger attachment with JetBrains Rider to work correctly,
3737
`Generate Shell Scripts` needs to be enabled in the JetBrains ToolBox
3838
and the generated shell scripts need to be on the path (Mapperly calls `rider attach-to-process {pid} {Mapperly-Sln-File}`).
39+
40+
## CSC warning CS8785 stack trace
41+
42+
If you see the compiler warning `CS8785: Generator 'MapperlyGenerator' failed to generate source`,
43+
you can get a stack trace from the C# compiler by emitting a compiler error log. The stack trace is included in the SARIF output.
44+
45+
Add the following MSBuild property when you build:
46+
47+
- `/p:ErrorLog=compiler-diagnostics.sarif`
48+
49+
Then open the SARIF file to inspect the generator exception and stack trace.

0 commit comments

Comments
 (0)