World Congress 2026 Europe

Code that writes code - .NET Source generators

July 9, 2026 16:50 – 17:20 · 30 min Stage 6 - powered by Microsoft

What this session covers

Tired of writing repetitive boilerplate code? Enter .NET Source Generators - your key to automating code generation at compile time. In this session, we’ll explore and demystify this powerful feature that lets you inspect your codebase and generate new C# source files during compilation.

You’ll learn how to create source generators from the ground up, including working with the Roslyn compiler API to analyze syntax trees, semantic models, and symbols. Don’t worry, it’s actually easier than it sounds! We’ll explore practical techniques for traversing your codebase, filtering syntax nodes, and generating precise, context-aware code that integrates seamlessly with your existing projects.

Through hands-on examples, we’ll implement source generators that solve real-world problems. We’ll cover examples like creating strongly typed entity IDs to prevent primitive obsession, generating boilerplate code, auto-implementing interfaces, building compile-time helpers and more.

This session is designed for intermediate to advanced .NET developers, team leads and architects looking to improve code maintainability, as well as anyone interested in meta-programming and code generation.

After this session, attendees will gain a thorough understanding of source generator architecture and lifecycle, along with practical knowledge of working with the Roslyn API for code analysis. They’ll learn essential techniques for debugging and testing source generators, good practices for implementing them in production projects, and acquire a toolkit of ready-to-use patterns for some common source generation scenarios.

Related talks at this congress

Open session

World Congress 2026 Europe

July 10, 2026 · 09:40–10:10

Stage 12

Xcode development redefAIned

MIlan Todorović

Apple Certified Trainer at Crossover

MIlan Todorović
Open session

World Congress 2026 Europe

July 10, 2026 · 09:00–09:30

Stage 11

GenAI Is a Junior Dev With Root Access

Julian Totzek-Hallhuber

Lead Solutions Architect at XBOW

Julian Totzek-Hallhuber
Open session

World Congress 2026 Europe

July 9, 2026 · 10:30–12:30

Room Ulm (35 Seats)

GitHub Copilot: From Zero to Hero

Lisa Becker, Tugdual Grall

Lisa Becker
Tugdual Grall
Open session

World Congress 2026 Europe

July 9, 2026 · 16:10–16:40

Stage 6 - powered by Microsoft

Practical tips for keeping your C# code base clean

Dennis Doomen

Principal Consultant at Aviva Solutions

Dennis Doomen
All sessions at this congress