In this post, I will describe a new feature of the Microsoft.Extensions.Hosting library coming in .NET 8 (available since preview 4) affecting hosted services. Let’s first begin with a brief recap of hosted services. The hosting library for .NET, used in both the ASP.NET Core project template and the Worker Service template, provides the capability […]
Category: .NET
Accessing State in System.Text.Json Custom Converters
In this post, I describe several techniques that can provide additional state to custom JsonConverters when using System.Text.Json. While building the new .NET client for Elasticsearch, one of the key objectives I gave myself was to move away from the internal Utf8Json-based serializer used in v7. The obvious choice was to look at redesigning the […]
Creating, Inspecting and Decompiling the World’s (Nearly) Smallest C# Program
In this post, I thought it might be fun to create the world’s (nearly) shortest C# program and then deep dive into some of the fine details of what happens behind the scenes. This post is not intended to solve a real-world problem but I hope it’s well worth your time spent reading it. By […]
Using the Roslyn APIs to Analyse a .NET Solution
In this post, I demonstrate how to analyse a .NET solution using the Roslyn APIs and aMsBuildWorkspace.
Custom JSON Serialisation with System.Text.Json Converters
This post is my contribution to the .NET Advent calendar. Make sure you check out the other amazing posts on the lead up to Christmas! At the time of writing, I am deep into work on some significant changes in the Elasticsearch .NET client. One of the changes is moving to System.Text.Json as the default […]