The LoggerMessage Source Generator: High-Performance Logging
How the LoggerMessage source generator eliminates boxing, string allocation, and reflection in .NET logging for maximum throughput.
The JSON Source Generator in System.Text.Json
How the System.Text.Json source generator eliminates reflection-based serialisation, improving startup time and enabling AOT compilation.
The Regex Source Generator Explained
How .NET 7's GeneratedRegex attribute uses source generation to compile regular expressions at build time for better performance.
Attribute-Driven Source Generation Patterns
Explore patterns for using marker attributes to drive source generation, including attribute discovery, property extraction, and handling edge cases.
Testing Source Generators with Microsoft.CodeAnalysis.Testing
A practical guide to testing source generators and analysers using the official Microsoft.CodeAnalysis.Testing framework.
Emitting Diagnostics from Analysers and Source Generators
Learn how to report errors, warnings, and informational messages from analysers and generators using the Roslyn diagnostics API.
Debugging Source Generators: Techniques That Actually Work
Practical strategies for debugging source generators, from Debugger.Launch() to emitting generated files to disk.
The IIncrementalGenerator Pipeline: Transforms, Filters and Caching
A deep dive into the incremental generator pipeline operators — Where, Select, Collect, and Combine — and how they enable efficient caching.
Incremental Source Generators: A Practical Guide
A hands-on introduction to incremental source generators, the modern replacement for ISourceGenerator that offers dramatically better IDE performance.
Code Fix Providers: Turning Analyser Warnings into One-Click Fixes
Learn how to pair a Roslyn analyser with a code fix provider that offers automated corrections directly in the IDE.
Writing a Custom Roslyn Analyser from Scratch
Build a custom Roslyn analyser that flags methods exceeding a configurable line count, complete with project setup and testing.
Syntax Trees and the Semantic Model: Roslyn's Two Pillars
Understand how Roslyn represents code as syntax trees and enriches it with semantic meaning through the semantic model.