Session

Roslyn Source Generators - Never send a human to do a machine's job

.NET Source Generators are the latest metaprogramming technique to add C# code to your compilation.
They help us automate tedious boilerplate implementations of common patterns, replace Reflection-based logic with high-performance strongly typed solutions, and - in some scenarios - enable Native AOT deployments.
Introduced in .NET 5, their capabilities are expanded in .NET 6, which also starts utilizing their power in order to level up well-established scenarios, such as logging, JSON (de)serialization, and regular expressions. Additionally, C# 9.0 adds module initializers and extends partial methods, C# 11 adds file-scoped types, and C# 12 previews Interceptors to further compile-time code generation.

Not only would I like to show you these language features plus the basic mechanics of adding new sources and reporting diagnostics via (Incremental) Source Generators, but also cover a selection of advanced topics, including unit testing (both the Generator itself and the code it generates), code coverage, mutation testing, benchmarking, and how to use nullable reference types within .NET Standard 2.0 Generator-Projects. As a bonus, I shall deliver a suite of (web) tools to kick-start your journey.

TL;DR - C# Source Generators: Would you like to know more?

Technical requirements: Internet access
Target audience: proficient .NET/C# developers
Preferred session duration: 45 - 60 minutes, including Q&A

Stefan Pölz

Clean C# Coder – Test-driven .NET Developer

Vienna, Austria

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top