Source Generators in C# 9: Compile-Time Code Generation

Source Generators allow you to inspect code during compilation and generate new C# files on the fly. Unlike Reflection (runtime slow) or IL Weaving (complex), Source Generators are fast, debuggable, and integrated into Roslyn. How it Works Example: INotifyPropertyChanged Automate the boilerplate of MVVM. Key Takeaways Generators can **add** code, but cannot **modify** existing code. […]

Read more →

.NET 5: Performance Improvements Deep Dive

.NET 5 is the fastest .NET version ever releases. The engineering team has gone through the runtime and libraries with a fine-toothed comb, optimizing everything from the impacts of the Garbage Collector (GC) to the internals of List<T>. Let’s look at the numbers. TechEmpower Benchmarks In the TechEmpower benchmarks (Round 19/20), .NET 5 performs exceptionally […]

Read more →

.NET 5 is Here: The Complete Migration Guide

.NET 5 is the first step in the “One .NET” vision, unifying .NET Core and Mono. It drops the “Core” branding but keeps the Core architecture. This guide covers the migration from .NET Core 3.1, highlighting the breaking changes and performance wins. Project File Changes Update your TFM (Target Framework Moniker). Single File Applications .NET […]

Read more →

gRPC-Web: Bringing gRPC to Browser Applications

gRPC is great for microservices, but browsers don’t support HTTP/2 trailers required for standard gRPC. **gRPC-Web** is the protocol adaptation that makes it possible. In .NET, we can now host gRPC-Web services natively alongside standard gRPC. Configuring .NET Server Client Consumption Key Takeaways No need for an external Envoy proxy anymore (though still valid). Performance […]

Read more →

C# 9.0 Init-Only Setters: Immutable Object Initialization

Before C# 9, to make a property immutable, you had to use constructor injection. This broke object initializers (`new Obj { Prop = val }`). The `init` accessor solves this by allowing setting a property only during object initialization. The ‘init’ Keyword Why this matters for DTOs It allows for consistent, valid state without massive […]

Read more →