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.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-02-05 11:00:00 +0000
Seen: 9 times
Last updated: Jul 14 '21
How can I incorporate Blazor Web Assembly into my current .Net Core 6 project through injection?
How do I create an index.html page for the js project in D3 JS?
Where can I find the location of the NuGet packages I have downloaded for my project?
How can ASP.NET be designed using a Bootstrap template?
How can I include a DLL in my Visual Studio project if the Browse option is unavailable?