- Loading...
Sponsored by Dometrain Courses—Get 30% off Dometrain Pro with code ANDREW30 and access the best courses for .NET Developers

My new book ASP.NET Core in Action, Third Edition is available now! It supports .NET 7.0, and is available as an eBook or paperback.

Saving source generator output in source control
Creating a source generator - Part 6
In this post I show how to emit your source generator output to disk, so you can include it in source control and code reviews.…

Finding a type declaration's namespace and type hierarchy
Creating a source generator - Part 5
In this post I show a couple of handy patterns for source generators: finding a type declaration's namespace and its class hierarchy…

Customising generated code with marker attributes
Creating a source generator - Part 4
In this post I describe how to customise a source generator by reading properties from a marker attribute…

Integration testing and NuGet packaging
Creating a source generator - Part 3
In this post I describe how to integration-test your source generator, how to pack it in a NuGet package, and how to test your NuGet package!…

Testing an incremental generator with snapshot testing
Creating a source generator - Part 2
In this post I describe how to unit test an incremental generator using Verify for snapshot testing…

Creating an incremental generator
Creating a source generator - Part 1
In this post I walk through how to create a practical .NET 6 incremental source generator: an enum extensions class with a fast ToString() implementation…

