❔ Incremental Generator compilation error
I'm trying to figure out what is wrong with my helloworld generator.
Here is my super simple generator, that adds a generated attribute to the source.
And after adding it I just can use them in my main project like that
The problem is that now I have a compilation errors and since this is my first attempt to use generators, I have no clue what I did wrong. Any ideas?
6 Replies
#roslyn
Does it build when doing
dotnet build
?I found the reason already 😅
This is because I used in my source generator project .netstandard 2.1
After changing it to 2.0 everything works perfectly
But when I use .netstandard2.1 it fails only when doing
dotnet build
. The project in IDE looks good, no errors and all generated types are accessibleah, yeah, that'd do it
Generators have to target 2.0
CoreCLR Visual Studio when
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.