How can I see the generated source files? #48811
-
I have written a source generator, and it is working well. But I want to check the generated source code to see whether it actually is what I want it to be (and to test some edge cases). I couldn't find any way to see what my generator is producing. What am I missing? Is there a switch I need to turn on? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Add The files will appear in your intermediate directory in a folder called (Note that this is only really intended for debugging, as noted in the discussion when this feature was added.) |
Beta Was this translation helpful? Give feedback.
-
How can I add these files to the repository? Is the path fixed? |
Beta Was this translation helpful? Give feedback.
Add
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
to your project properties and build.The files will appear in your intermediate directory in a folder called
generated
. (IE:path/to/project/obj/Debug/net5.0/generated/
)(Note that this is only really intended for debugging, as noted in the discussion when this feature was added.)