gerard
❔ Source Generator does not work in .NET CLI
When I compile my project in Rider, everything works fine:
but when I try to build it with the CLI (
dotnet build
or dotnet publish
), I get the following:
In my .csproj I included the source generator with a project reference:
The source generator generates the following:
and in code I do the following:
I tried both net8.0
(preview 2) and net7.0
, with and with-out <PublishAot>true</PublishAot>
.
What am I missing? Should I try to remove the preview SDK and see if it works..?3 replies