Question – C# Code Generation with RoslynAnalyzer question
I’m developing an experimental c# code generation plugin for my project what will auto-generate some boilerplate custom serialization code. I have it running, and it seems to be generating code, but something in my codebase is causing it to generate bad code. I can see the errors on the build console, and the errors start with:
DistributedEntityGenerator/SourceGenerator.DistributedEntityGenerator/ImpunityDistributedMethodsGenerated.cs(5,7): error CS0246: (etc etc C# error here)
I’d love to be able to look at the generated code to see what the problem is, but I can’t find a file with that name anywhere in my project. Is there a way to have Unity output the generated source to the filesystem somewhere? Or alternatively, is there a way to have my code analyzer output log info to the Unity console when it runs?
I’m pretty excited about the possibilities of using generated code in my Unity projects, so I hope I can get this figured out!
Read more here: Source link
