Hands-on: Roslyn Source Generators
Speakers: Shahab Ganji & Stefan Pölz
Abstract:
In today’s fast-moving world of software development, in order for engineers to be able to focus on the business rules and domain logic, it is imperative to delegate infrastructural plumbing to the compiler. As C# coders, we have the advantage of utilizing Roslyn to generate such boilerplate code. Additionally, source-level interception can replace reflection-based dynamic code for trim-friendlier applications.
At the end of this workshop, you will have hands-on experience of how the .NET ecosystem employs Source Generators for high-performance solutions and a solid understanding of how frameworks like ASP.NET Core use Interceptors to enable Native AOT (ahead-of-time compilation) for Minimal APIs.
Agenda
– Basics of metaprogramming with Roslyn
– Understanding Syntax Trees and Semantic Models
– Incremental Source Generators
– C# Interceptors
– Testing and Debugging
– Publishing as NuGet package
– Tooling
– Real-world use cases from the ecosystem
– Where to go next
Target Audience
You, who are familiar with C#, are enthusiastic about performance optimization and interested in how to use Roslyn in your day-to-day development experience.
Prerequisites
– Laptop
– Latest .NET SDK
– Your preferred IDE
– Rider
– Visual Studio 2026
– Visual Studio Code
– Access to NuGet.org
