.NET 5 Source Generators. How use also referenced assembly

1.3k Views Asked by At

I try to use .NET 5 Source Generators for generate webapi controllers starting from commands and queries.

I use this article [example]https://www.edument.se/en/blog/post/net-5-source-generators-mediatr-cqrs for this

But i want use commands and queries classes in external project referenced assembly for generate controllers in webapi project but I don't understand how give instructions to syntax receiver for this.

The structure of my solution is:

Projects

SourceGenerator.csproj

   `MySourceGenerator.cs`

Application.csproj

 Commands
     `ExampleCommand.cs`

WebApi.csproj

   References
      `SourceGenerator.csproj` (with OutputItemType="Analyzer")
      `Application.csproj`
   Controllers
      `VirtualExpectedGeneratedController.cs`
0

There are 0 best solutions below