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.

World Congress 2026 Europe

Related talks

Open session

Xcode development redefAIned

  • MIlan Todorović

    Crossover

    Apple Certified Trainer

Open session

GenAI Is a Junior Dev With Root Access

  • Julian Totzek-Hallhuber

    XBOW

    Lead Solutions Architect

Open session

GitHub Copilot: From Zero to Hero

  • Lisa Becker

    GitHub

    Solutions Engineer

  • Tugdual Grall

    GitHub

    Strategic AI GTM Lead

Open session

Practical tips for keeping your C# code base clean

  • Dennis Doomen

    Aviva Solutions

    Principal Consultant

All sessions at this congress