csharp-source-generators

Source generators

A collection of C# source generator projects and resources

A list of C# Source Generators (not necessarily awesome) and associated resources: articles, talks, demos.

GitHub

2k stars
80 watching
206 forks
last commit: about 2 years ago
Linked from 1 awesome list

awesome-listcsharpcsharp-sourcegeneratordotnetlistroslyn

C# Source Generators / Documentation and samples

docs.microsoft.comofficial documentation
dotnet/roslyn feature design document19,145almost 2 years agodescribing the compiler feature
dotnet/roslyn cookbook19,145almost 2 years agoto help with generator creation
dotnet/roslyn-sdk samples517almost 2 years agoshow how to implement a source generator and use features like external package references ( generators). Includes AutoNotify, Csv, Maths, Mustache, and SettingsXml
SourceGeneratorPlaygroundan online Source Generator Playground to play with generator ideas 💡 without any setup noise.
davidwengier/SourceGeneratorTemplate182over 4 years agoA basic template for writing a C# source generator, from the Roslyn dev

C# Source Generators / Source Generators / Dependency Injection (IoC Container)

AutoCtor85almost 2 years agoAutoCtor is a Roslyn Source Generator that will automatically create a constructor for your class for use with constructor Dependency Injection
AutoRegisterInject73over 2 years agoAutomatically generate Microsoft Dependency Injection ServiceCollection registrations for your classes from attributes
DependencyInjection.SourceGenerators6over 2 years agoThis project is a C# source generator designed to simplify and automate the registration of dependencies in Microsoft's Dependency Injection service collection. By using this package, developers can enhance the clarity and efficiency of their code by reducing the need for manual service registration
DependencyManagement11almost 4 years agoThe Dependency Management is a very fast dependency injection and components container, with many interesting features, and without reflection
GrpcInjection8over 4 years ago- GrpcInjection is a tool that allow you to inject Services and Interceptor in time of compilation inside of GRPC Projects using C# source generator
Injectio136almost 2 years ago- Source generator that helps register discovered services in the dependency injection container
Jab1,050over 2 years ago- Compile Time Dependency Injection
lambdajection16over 2 years agoFramework for building AWS Lambdas using dependency injection and aspect-oriented programming
MrMeeseeks.DIE7almost 2 years agoAn unambigous, convenient, flexible and feature rich compile time dependency injection container
Pure.DI539almost 2 years ago- dependency injection for .NET without any IoC/DI containers, frameworks, dependencies, and thus without any performance impact and side-effects
SourceInject79almost 4 years agoA source generator that allow you to generate your services for dependencies injection during compile time
StrongInject852about 4 years ago- compile time dependency injection for .NET
Thunderboltloc57over 3 years agoOne of the very first IoC frameworks for .Net that has no reflection

C# Source Generators / Source Generators / Console / CLI

AutoSpectre21about 2 years agoGenerates a service for prompting and populating a class using the Spectre.Console library
docopt.net356about 2 years agogenerates C# source code that parses command-line arguments into a strong-typed arguments class (also generated), given the as part of the CLI. In other words, write the help message for your program and get the entire parser generated for free!
Figgle440about 2 years ago- Generate ASCII banner text at compile time (or run time) using figlet fonts

C# Source Generators / Source Generators / Mappers

AutoDto24almost 3 years ago- A source generator that generates DTO models from BL to avoid same BL and DTO models
Flattening29about 5 years ago- C# source generator for generating flattened classes from complex domain classes
GraphQL.Tools96almost 5 years ago- A GraphQL to C# compiler (code-generator) which turns your GraphQL schema into a set of C# classes, interfaces, and enums
Mapperly3,007almost 2 years ago- A source generator for generating object mappings. Inspired by MapStruct
MappingCloningExtensions2over 2 years agoGenerates extensions of objects for mapping and cloning using either attributes or fluent style. Also, supports deep copying and specfiying whether it can do a deep copy and the possibility of doing so safely
Mapster4,399over 2 years ago- A fast, fun and performant object to object Mapper. Has better performance and is more memorry efficient than Automapper. Besides code generation, supports also Fluent API
MapTo94about 2 years ago- A convention based object to object mapper similar to Automapper
NextGenMapper42almost 2 years agoEasy-to-use mapper without configuration
SourceMapper8over 4 years ago- generates Mappers code based on attributes used on interfaces or abstract classes. It is inspired by Java
SourceMapper5about 5 years agoA source generator that creates extension methods for cloning and mapping

C# Source Generators / Source Generators / Communication

CoreWCF1,673almost 2 years agoCoreWCF provides support of WCF server side code on .NET Core / .NET6. CoreWCF allows users to inject services into implementation using a source generator to provide an implementation that fits the expected . The supplied implementation fetch services from the DI container the same way the attribute works in ASP.NET core MVC Controllers. The source generator supports both a dedicated attribute and the ASP.NET Core MVC attribute
Imp.NET41over 4 years ago- a fast, high-level, object-oriented C# networking library that supports the invocation of remote methods through proxy interface objects
IoTHubClientGenerator17about 3 years agoBuild a C# Azure IoT Device client program in seconds!

C# Source Generators / Source Generators / Graphics / Drawing

ComputeSharp2,799almost 2 years agoA .NET library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders, which are transpiled from C# and precompiled at build-time using source generators
Svg to C# Source Generators484almost 2 years agoSVGC compiles SVG drawing markup to C# using SkiaSharp as rendering engine. SVGC can be also used as codegen for upcoming C# 9 Source Generator feature

C# Source Generators / Source Generators / Enums

BetterEnums39over 2 years agoC# Enums with values and better performance as a source generator
Credfeto.Enumeration.Source.Generation22almost 2 years agoEnum to text generator for enums - generates strongly typed enums for all enums in the assembly, and using attribute for third party enums. Also includes an analyzer to ensure that all enum usages use the extension method rather than
Enum.Source.Generator181almost 2 years agoA C# source generator to create an enumeration (enum) class from an enum type. With this package, you can work on enums very, very fast without using reflection
EnumClass4over 3 years agoGenerate Kotlin's from C# with additional features like Switch function (instead of statement). It also contains support libraries like generator for JsonConverter for generated classes
EnumerationClassGenerator16about 4 years ago- A C# source generator to create an enumeration class from an enum type
EnumFastToStringDotNet31over 4 years ago- Automatically generates enum extension methods that implement a switch expression based ToString method
EnumUtilitiesGenerator23about 4 years ago- A source generator to generate compile-time mapping of enums and description attributes
FastEnumGenerator1over 4 years agoAn enum like generator where you create a partial class with private enum and it will generate an enum like record struct even including returning the words and a list
JOS.Enumeration26almost 2 years agoEnumeration class powered by source generation

C# Source Generators / Source Generators / Functional Programming

Generator.Equals138almost 2 years agogenerates equality and hashing for classes and records, supports a number of strategies for comparing collections and properties
RSCG_UtilityTypes4over 2 years agoAdd Omit and Pick attributes to generate classes from existing class, like in TypeScript
Strongly36over 2 years agoEasily generate serializable domain value types
ValueObjectGenerator40almost 6 years agoC# source generator is for ValueObjects (ie.Wrapper classes)
Vogen900almost 2 years agoC# source generator and code analyser that generates strongly typed domain identities
WrapperValueObject53almost 4 years ago- for creating simple value objects wrapping primitive types
Immutype41almost 2 years ago- generates extension methods to support immutability
Visor3almost 3 years agoC# optics library with incremental code generator (maintained fork of )
AnyOf110almost 2 years agoThe Source Generator creates a type to handle multiple defined types as input parameters for methods
dotVariant70about 2 years agoA type-safe and space-efficient sum type for C# (comparable to discriminated unions in C or C++)
Dunet652almost 2 years agoA simple source generator for in C#
Funcky Discriminated Unions6almost 2 years agoA source generator that generates methods for all your discriminated unions needs. ✨ Can be used with or without the functional programming library Funcky
N.SourceGenerators.UnionTypes10over 2 years agoDiscriminated union type source generator
Unions10over 2 years agofor generating meaningful, efficient union types

C# Source Generators / Source Generators / Serialization

AutoDeconstructable33almost 2 years agoGenerator for efficient and automatic flat text serializer/deserializer using in library
Azura4over 4 years agoGenerates binary [de]serializers on Streams at design time
CSV-Parser-Generator5over 2 years agoA Parser for CSV with support for uncommon line separators (e.g. Unicode) and instantiation of read-only objects and working nullable handling
ProtobufSourceGenerator12almost 2 years ago- A source generator that generates partial helper classes where member properties are attributed with ProtoMember attribute
SerdeDn (serde-sn)159almost 2 years agois a port of the popular Rust serialization/deserialization library to .NET. Basic cases are fully automated using a C# source generator
SpreadCheetah353almost 2 years agoCreate Excel files with a C# Source Generator for generating the rows
StackXML50almost 4 years agoStack based zero-allocation XML serializer and deserializer
StructPacker77about 4 years agobinary serializer that auto-generates C# serialization code to achieve peak runtime performance and efficiency
Tinyhand21almost 2 years ago- Tiny and simple data format/serializer using a source generator
GeneratedJsonConverters5almost 2 years ago- generate json converters for polymorph contracts and string based enum serialization
JsonByExampleGenerator78over 3 years ago- generate classes based on example json files in your project
JsonDeserializeResourceSourceGenerator2almost 4 years agoInstead of having to do embedded resource, can instead have json as additional file and it will produce a c# string and will deserialize to a type specified
JsonPolymorphicGenerator7about 3 years ago- Source Code Generator for System.Text.Json JsonDerivedType attributes on polymorphic classes
JsonSerializerContextGenerator2over 4 years agoA source generator that produces nearly the same code ahs system.json.text but easier to use because you only have to put an attribute for a model class you want to produce for. Also, produces a method to register to make it easy to use that source generator when serializing/deserializing json
JsonSrcGen146about 5 years ago- compile time JSON serializer generation
TeuJson1over 2 years agoA Reflection-less and Lightweight Json Library using source generator

C# Source Generators / Source Generators / Localization

kli.Localize34about 2 years ago- localize strings from json files via source code generation
MrMeeseeks.ResXToViewModelGenerator6over 2 years agoTakes ResX files and generates localization ViewModels for a more convenient usage of localization in MVVM projects
ResXGenerator31over 2 years agoGenerates strongly-typed resource classes for looking up localized strings

C# Source Generators / Source Generators / Testing

Buildenator20almost 2 years agoGenerate data builder classes for testing purposes (and not only) for your entities. Autofixture + Moq extensions
FluentAssertions.Eventual5over 2 years ago- Generates a specialized waiting wrapper for assertions, offering a syntax similar to plain
ScenarioTests46almost 4 years agoTest your code like you would write a notebook. Simply and effective
GRPC-Mock-Server32almost 2 years ago- A source generator for stubbing GRPC services
InterfaceGenerator36over 2 years ago- Auto generate interface definition by implementation, for when you need an abstraction for the sake of mocking
MockableStaticGenerator14about 4 years agoA C# source generator to make an interface and a class wrapper to test static/extension methods
MockGen16over 4 years agoA C# mocking library based on source generators
MockSourceGenerator11over 5 years agoA C# mocking library that generates mocks at compile-time using a source generator
ProxyInterfaceGenerator39almost 2 years agogenerate an interface and a Proxy class for classes. This makes it possible to wrap external classes which do not have an interface, in a Proxy class which makes it easier to Mock and use DI
Rocks266almost 2 years agoA mocking library based on the Compiler APIs (Roslyn + Mocks)

C# Source Generators / Source Generators / Patterns

Lombok.NET316almost 2 years agoGenerates boilerplate code and common code patterns. As the name suggests, it is the .NET version of Java's Lombok
DumplingsDevs.Pipelines43almost 3 years agoThe most flexible mediation implementation in the .NET ecosystem with your own types
Immediate.Handlers78almost 2 years agoAn implementation of the Mediator pattern in .NET using source generators, without using a central mediator instance
Mediator2,168about 2 years ago- a high performance implementation of Mediator pattern in .NET using source generators
MediatR controllers generator37over 3 years agoThis generator generates controllers and their methods based on your requests
Plastic59about 2 years agoThis project provides encapsulation of things like Domain, Application Rules, Business Rules or Business Logic in Application
Data Builder Generator116about 2 years agoGenerate data builder patterns for your model classes
FluentBuilder175almost 2 years ago- A project which uses Source Generation to create a FluentBuilder for a specified model or DTO
M31.FluentAPI103almost 2 years ago- Generate fluent APIs for your C# classes with ease
avatar138over 3 years agoA modern compile-time generated interception/proxy library
DudNet3almost 3 years agoA C# source generator for implementing a proxy pattern
MrMeeseeks.Visitor2over 3 years agoGenerates the boilerplate code for applications of the Visitor pattern
AutoInterface76about 2 years agointerface-to-member source generator

C# Source Generators / Source Generators / Domain Driven Design (DDD)

AltaSoft.DomainPrimitives53almost 2 years ago- A C# toolkit purposefully designed to accelerate the development of domain-specific primitives within your applications. This streamlined solution empowers developers to efficiently encapsulate fundamental domain logic. Through this toolkit, you'll significantly reduce code complexity while improving the maintainability of your project
Architect.DomainModeling64over 2 years agoA complete Domain-Driven Design (DDD) toolset for implementing domain models, including base types and source generators for ValueObjects, WrapperValueObjects, Entities, and Identities

C# Source Generators / Source Generators / Metaprogramming

GenerateHelperLibraries1over 2 years agoA source generator where you can send any code to the client without having to do as a string. Helper for custom classes a client has to override in order to have additional features for source generators. Intended to be used from another source generator
Gobie98about 3 years ago- Allows developers define and use custom source generation without writing any generator code themselves or learning the Roslyn APIs. Instead, devs define the generator they want, in C#, and can then use that generator throughout their project
Matryoshki29almost 2 years agoMetaprogramming framework based on C# source generators. It allows you to define behaviours with adornments and generate decorators for arbitrary types
SourceGeneratorQuery24over 3 years ago- C# SourceGenerator helper which helps you query your files, and adds LINQ support

C# Source Generators / Source Generators / Webprogramming

AjaxService.Gen19almost 3 years ago- Automatically Generate typescript Ajax calls based on your C# Api endpoints
ApiClientGenerator20almost 2 years agoGenerates a strongly typed HttpClient based off MVC's default routing. Can be used to output into multiple projects, like Blazor WebAssembly
ControllerGenerator8about 3 years agoAutomatically generate controllers from services in a web application
HttpClientCodeGenerator45almost 2 years ago- HttpClientGenerator is a tool that uses the Roslyn code generator feature to write boilerplate HttpClient code for you
Ridge50almost 3 years agoGenerates strongly-typed clients for API based on controller definition and internal application details
Safe-Routing31about 2 years agoAnalyses a project's razor pages and MVC controllers, producing strongly-typed representations of those routes as you type
TypedSignalR.Client152almost 2 years agoC# Source Generator to create strongly typed SignalR clients
H.NSwag.Generator21almost 2 years ago- C# Source Generator for NSwag
SourceApi14almost 5 years ago- API first Open API code generator based on json or yaml definitions. It generates base abstract controllers with docs, routes, that you inherit and implement in your controllers
ST.NSwag.ServerSourceGenerator4almost 4 years agoGenerates Web API/ASP.NET Core controllers from a OpenAPI specification
BlazorInteropGenerator15almost 2 years agoGenerates Blazor -> Javascript strongly typed interop methods, by parsing the Javascript it self and generating extension methods for IJSRuntime
BlazorOcticons21over 2 years agoGithub created as a components using source generator. The generated components are available via the NuGet package, the generator itself is available as a separate NuGet package. The project is an example using the generated components
MiniRazor225about 3 years agoPortable Razor compiler & code generator
RazorPageRouteGenerator13almost 2 years agoGenerates methods with parameters for Razor and Blazor pages, so you can navigate without having to guess URLs or parameters

C# Source Generators / Source Generators / XAML / WPF / Avalonia

Avalonia.NameGenerator85about 3 years agoGenerates typed references to named XAML controls
boilerplatezero38almost 3 years agoWPF Dependency Property and Routed Event generator
DependencyPropertyGenerator119almost 2 years agoDependency property and routed event source generator for WPF/UWP/WinUI/Uno/Avalonia/MAUI platforms
WinUI-ObservableSettings5about 3 years ago- Generate boilerplates to read and write settings in packaged WinUI 3 app
PropertyChanged.SourceGenerator140about 2 years ago- Powerful INotifyPropertyChanged Source Generator, which generates INPC boilerplate for you as part of your build. Supports features such as automatic and manual dependencies between properties, notifications when specific properties change, and more
ValueChangedGenerator13about 3 years agofor generating PropertyChanged from inner struct members
DevExpress.Mvvm.CodeGenerators41almost 2 years agoGenerates boilerplate code for your View Models (INotifyPropertyChanged, Commands, IDataErrorInfo, DevExpress services). Compatible with the Prism and MVVM Light libraries
Microsoft MVVM Toolkit3,119almost 2 years agoA modular MVVM library with support for source generators to reduce boilrplate and improve performance
MvvmGen255almost 3 years agoA lightweight MVVM library for XAML applications that generates your ViewModels with a C# Source Generator

C# Source Generators / Source Generators / Database / ORM

AdaskoTheBeAsT.Identity.Dapper7almost 2 years ago- Custom Dapper implementation for Microsoft.Extensions.Identity.Stores (part of ASP.NET Core Identity)
Breezy26about 3 years agoMicro ORM with source generator
MapDataReader67over 2 years ago- Fast mapping to a custom class
SqlMarshal59almost 2 years agoNative AOT friendly-performant mini-ORM. Generation of wrappers for accessing SQL using ADO.NET

C# Source Generators / Source Generators / Statically typed resources / configurations

dot-env-generator34almost 4 years agoA source generator for C# that turns files into runtime constants
EnvVariablesGenerator3over 2 years agoGenerate code from files that can be changed after build
NotNot.AppSettings30almost 2 years agoAutomatically create strongly typed C# settings objects from AppSettings.json
SourceConfig12about 2 years ago- Generates configuration POCO objects, lists, dictionaries in AOT based on *.json config files
StronglyTypedEmbeddedResources9almost 3 years agoGenerates strongly typed names for Embedded Resources automatically
TxtToListGenerator0over 4 years agoA source generator where if you have a text file as additional file and you have a list ordered by return carriages, then it produces either a list of int or a list of string in c#

C# Source Generators / Source Generators / Text templating

Transplator32almost 4 years agoA simple C# source generator for text templates
Weave23almost 3 years agoWeave is a text templating engine for .NET that is all about attention to detail. Weave handles the tricky work of making your rendered text beautiful

C# Source Generators / Source Generators / Other

AutoConstructor52almost 2 years agoC# source generator that generates a constructor from readonly fields/properties in a class or struct
AutoFilterer.Generators463over 2 years agoAutoFilterer.Generators aims to generate filter DTOs from entities automatically via using dotnet source generators
AutomaticInterface63almost 2 years agoGenerate an Interface from a class
AutoInvoke9over 2 years agoA generator that generates a method that invokes a specified generic method, for every Type in your project that satisfies a defined constraint
BigMachines38almost 2 years agoBigMachines is State Machine library for .NET
BitsKit43almost 2 years agoA C# library for efficient bit-level reading and writing also adding bit field support
CacheSourceGenerator4over 2 years agoGenerates an IMemoryCache wrapper around a method call
Cloneable73over 3 years agoauto-generate Clone method
Durian58about 4 years agoExtends the default capabilities of C# by mimicking features from other languages
Fairy4over 5 years agogenerates C# code based on Sitecore Content Serialization (SCS) files
FastGenericNew244almost 2 years agoThe ultimate fast alternative to / . Built on SourceGenerator V2 (Incremental Generator)
GitBuildInfo.SourceGenerator39over 4 years ago- for dumping the git information (commit hash, branch, the head description) into assembly level metadata attributes
Hangfire.RecurringJob5over 2 years ago- Automatically generates the recurring job registration code
IDisposableGenerator15over 2 years ago- a Source Generator for Generating the Dispose functions in Disposables. All you have to do is mark them with attributes and it will work from there
Lazysh7over 3 years agoLazy implementation of any interface
LinqGen290about 2 years agoAlloc-free and fast replacement for Linq, with code generation
LoggingDecoratorGenerator14over 2 years agoGenerates logger decorator class for an interface. Uses Microsoft.Extensions.Logging.ILogger to log and requires it in decorator class constructor
MemberAccessGenerator7about 6 years agogenerates and/or methods that return property value for a given property name or index (e.g. in positional records)
MrMeeseeks.StaticDelegateGenerator8about 5 years agoMakes static classes and members injectable as dependency by generating delegating interfaces and their implementing classes
Navitski.Crystalized8almost 2 years agoGenerates domain model based on schema files. Generated model supports undo/redo, saving to/loading from SQLite and Json files, precise changes tracking and more
net_automatic_interface63almost 2 years ago.Net Core Source Generator for Automatic Interfaces
PolySharp1,843almost 2 years agoProvides generated, source-only polyfills for C# language features, to easily use all runtime-agnostic features downlevel
PrimaryConstructor106over 2 years agoGenerate primary constructor from readonly fields
PrimitiveStaticDataGenerator9about 2 years agofor creating methods that return optimized static data from primitive values
PrintMembersGenerator6almost 6 years agohelps re-defining C# record's PrintMembers method to force include/exclude certain members
QuickConstructor26over 4 years agoA reliable and feature-rich source generator that can automatically emit a constructor from the fields and properties of a class. It can also generate null checks based on nullable reference types annotations
SmallSharp287almost 2 years agoCreate, edit and run multiple C# 9.0 top-level programs in the same project by just selecting the startup program from the start button
SmartAnnotations57over 5 years agoA library that uses source generators to automatically generate data annotations for your models. It provides a strongly-typed mechanism (fluent like API) to define your annotation rules
StringLiteralGenerator136about 2 years agofor optimizing UTF-8 binaries
SyncMethodGenerator49almost 2 years ago- Generates a synchronized method from your async code
ThisAssembly446almost 2 years agoExposes project and assembly level information as constants in the ThisAssembly class
ToString18over 3 years ago- C# source generator for implementing override like type
TupleOverloadGenerator5almost 4 years ago- Overload array parameter with tuples avoiding heap allocations
ValueLink10almost 2 years agoA C# Library for creating and managing multiple links between objects

C# Source Generators / Meta - libs and generators for other generators

AttributeFactoryGenerator1almost 3 years ago- Generate factories to easily parse actual attribute instances from symbol data
AttributesSourceGeneratorHelper2about 3 years agoA source generator to help another generator by producing attributes. Anything that inherits from Attribute will be sent to the client so you don't have to build strings for attributes
CommonSourceGeneratorsHelpers11over 2 years agoA generator to create many helpers for source generators to use to make up that its very difficult to reference third party libraries in source generators including extensions and a source code string builder
HotReload3almost 3 years ago- A simple hack to enable hot reload in Visual Studio Intellisense when developing a source generator project together with an example dependent client project inside a single solution
SourceGeneratorUtils21about 3 years agoAn essential library equipped with utility functions and helpers to aid in writing source files for source generators or for general purposes. Based on the source generator architecture for best-practices
SourceGenerator.Helper.CopyCode7over 2 years ago- A simple Generator that generates a string representation to an annotated Type

C# Source Generators / Articles

Series: Creating a source generator(2022-02-01) Complete series about how to create an incremental source generator, using the APIs introduced in .NET 6
Mastering at Source Generators(2022-01-15) Generating CRUD controller from DTO model using text template
Using C# Source Generators to create an external DSL(2021-01-27) that shows how to implement a simple DSL
4 ways to generate code in C# — Including Source Generators in .NET 5(2021-01-19) demonstrates the comparison between Source Generators, T4 template and Reflection, etc
.NET 5 Source Generators - MediatR - CQRS - OMG!(2020-12-16) explores how source generators can be used to automatically generate an API for a system using the MediatR library and the CQRS pattern
Source Generators in .NET 5 with ReSharper(2020-11-20) introduces source generators and briefly mentions how they are being worked into the ReSharper product
Source Generators - real world example(2020-11-09) contains a rich and deep dive into a real world generator with lots of useful tips
How to profile C# 9.0 Source Generators(2020-10-10) demonstrates how to profile your source generator using the
How to Debug C# 9 Source Code Generators(2020-10-09) contains debugging tips
How to generate code using Roslyn source generators in real world scenarios(2020-09-17) rich story of how ThisAssembly generator was written using Scriban templates
.NET Blog 'New C# Source Generator Samples' post(2020-08-25) that shows some simple samples
.NET Blog 'Introducing C# Source Generators' post(2020-04-29) that announces the feature

C# Source Generators / Videos

C# Source Generators - Write code that writes code - David Wengier(2020-11-13) Roslyn dev takes deep dive into the topic
.NET Languages and Runtime Community Standup - Source Generators(2020-10-08) shows how Generators work and how they can be tested
Channel 9 'Source Generators in C#'(2020-08-12) has Roslyn PMs discussing the feature

C# Source Generators / Demo, PoC and excercise projects

RyanAlameddine/SourceGeneratorDemo3about 5 years agocontains 3 demos: hello world, INPC and OpCode class
TMC-CSharp/CodeExerciseLibrary2almost 6 years agoLibrary to help creating C# exercises. Generates missing methods and classes inside tests on the fly by using Source Generators
DpdtInject32about 4 years agoDI container based on C# Source Generators. Its goal is to remove everything possible from runtime and make resolving process as faster as we can. This is achieved by transferring huge piece of resolving logic to the compilation stage into the source generator
jakubsturc/talk-csharp-source-generators3over 6 years agocontains 4 generators: AutoNotify, ConsoleWritelineHijack, HelloWorld and SettingsXml, plus nice presentation slides
Compile Time Method Execution Generator20almost 6 years agoproof of concept that allows executing a method during compilation, so that it can be really fast during runtime

C# Source Generators / Projects using custom Source Generators "internally"

Elskom/Sdk6about 2 years agoDumps git repository data to assembly level metadata attributes that can be checked at runtime for things like trapping if a user is using an possibly unstable build of the libraries built in the repository and so the user can see a message about it (and optionally opt into running the possibly unstable code)
Heroicons.AspNetCore13almost 2 years agothat are easy to use in ASP.NET Core MVC as TagHelpers
NetFabric.Hyperlinq875over 2 years agogenerates overloads for its extension methods
RestEase1,089almost 3 years agouses Source Generator to generate interface implementations on compile time instead of in runtime via Reflection.Emit
WarHub/wham21over 2 years agogenerates code for immutable tree object graph based on red-green node approach used in Roslyn; generates custom XmlSerializer that supports C#9 records and ImmutableArray

Backlinks from these awesome lists:

More related projects: