Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Yes, it is possible to use C# source generators to generate code in a separate project. You can create a class library project that contains the source generator and reference it from the project where you want to generate code. You can then specify the output directory for the generated code using the AdditionalFiles parameter in the GeneratorDriver.Create method. This allows you to generate code in a separate project and use it in your application.