CharlieDigital / chrlschn

Personal blog using Astro
MIT License
0 stars 0 forks source link

blog/2023/08/dotnet-source-generators-dotnet-7/ #7

Open utterances-bot opened 6 months ago

utterances-bot commented 6 months ago

@chrlschn - .NET Source Generators with .NET 7

Exploring .NET source generators to reduce boilerplate code in everyday code!

https://chrlschn.dev/blog/2023/08/dotnet-source-generators-dotnet-7/

thepigeonfighter commented 6 months ago

This is great, but just in case anyone else is reading this, you must use .netstandard2.0 according to this issue: https://github.com/dotnet/roslyn/issues/45162, I just attempted to use .net8 and the generator failed to run. Not sure the limitations on it, but probably best to stick with .netstandard2.0 unless you have some more info?

CharlieDigital commented 6 months ago

No additional info, but thanks for the feedback.

I too, have noticed that it's finicky. I definitely built this as-is with .NET 7, but have also noticed issues when starting new generator projects with .NET 8.

It doesn't hurt to use netstandard2.0