A list of C# Source Generators (not necessarily awesome) and associated resources: articles, talks, demos.
A list of C# Source Generators (not necessarily awesome), because I haven't found a good list yet.
C# Source Generators is a Roslyn compiler feature introduced in C#9/.NET 5. It lets C# developers inspect user code and generate new C# source files that can be added to a compilation.
AnyOftype to handle multiple defined types as input parameters for methods.
GetMember(string)methods that return property value for a given property name or index (e.g. in positional records).
ReadOnlySpanstatic data from primitive values.
Collection of tips and tricks (simple and brief to fit in Tweet):
TIL to debug a source generator in VS 16.10: upgrade Microsoft.CodeAnalysis.CSharp to 3.10.*, addtrueto source generator project, select Roslyn Component for Launch in Project Properties Debug page, choose Target then F5 :rocket:
See files emitted by #SourceGenerators by adding these properties to your (*.csproj) project file:true $(BaseIntermediateOutputPath)Generated
I made a thing: https://github.com/chsienki/Kittitas
If you're building Roslyn Source Generators or Analyzers check it out, it makes debugging them inside the compiler easier. #roslyn #csharp #dotnetcore #sourcegenerators #analyzers
Build failed in WPF projects microsoft/CsWin32#7:
If your build failed in a _wpftmp.csproj file you need to add following property to your (.csproj) project file:xml true
and use at least .NET 5.0.102 SDK
Maybe they can inspire you too!