Source generators are a powerful feature in .NET that allow developers to generate C# code during compilation. In this session, we’ll introduce the concept of source generators, explain how they work, and show how they can help reduce boilerplate, improve performance, and simplify complex patterns. We’ll cover the basics of creating a source generator using the Roslyn compiler API, explain the difference between standard and incremental generators, and demonstrate how generated code is included in your application. Through step-by-step demos, you’ll see how to build your first source generator, understand where it fits in the build process, and learn how to debug and maintain it. We’ll also look at real-world examples, including INotifyPropertyChanged implementation, configuration binding, and JSON serialization using System.Text.Json. This session is ideal for developers new to source generators who want to understand their capabilities and how to apply them in everyday .NET projects. No prior experience with Roslyn or code generation is required.
I am a Microsoft MVP and Software Development Engineer. A frequent regional and international speaker at Microsoft-related events and User Group meetings. While spending my free time, love to play chess, run in nature, write blog posts, help the community on StackOverflow to contribute to open-source projects, or be an instructor at NGO programming-related events. Completely dedicated to Software Development, mostly on the .NET platform, crafting apps using C# & .NET. Truly been in love with programming since my childhood days. ♥️