C# Source Generators: A Complete Guide to Compile-Time Code Generation
Master C# source generators with this complete guide. Learn how compile-time code generation works in .NET 10, why it beats reflection, and how to get started.
In-depth C# and .NET tutorials covering structured logging with Serilog, building Roslyn analyzers, NuGet packaging, and other core language and tooling topics.
Showing 133–138 of 264 articles
Master C# source generators with this complete guide. Learn how compile-time code generation works in .NET 10, why it beats reflection, and how to get started.
Learn how to control assembly scanning in Needlr, including filtering assemblies, controlling which types get discovered, and organizing type registration in .NET applications.
Learn how to use hosted services and background workers with Needlr, including automatic discovery of IHostedService and BackgroundService implementations.
Learn how to use keyed services in Needlr to register and resolve multiple implementations of the same interface using .NET 8's keyed service support.
Learn how to implement the decorator pattern in C# using Needlr's automatic decorator discovery, including the DecoratorFor attribute and manual decorator wiring.
Learn how to build modular .NET applications using Needlr's plugin system, including IServiceCollectionPlugin, IWebApplicationPlugin, and automatic plugin discovery.