Modern applications, especially cloud applications running on right-sized infrastructure, rely heavily on efficient resource management, but “efficiency” doesn’t always mean “low usage.” High CPU or memory consumption can be either a red flag or a sign of optimal performance, depending on the context. In this post, we’ll explore when to celebrate high resource usage—and when to panic—with a focus on .NET applications.
Continue reading “Understanding High CPU and Memory Usage: When to Act and When to Relax”Category: .NET
Future-proofing Result<T> Libraries
C# is coming ‘soon’ with Type Unions (see the official proposal and Nick’s video on this), which I think is great. However it’s not there yet and if you need it now it’s important t consider which library will require the least refactoring when this feature becomes part of the official language specification.
This post explores some of the most popular libraries in .NET for implementing this pattern and helps you decide which one fits your project’s needs.
Continue reading “Future-proofing Result<T> Libraries”Transitive Dependencies Gone Wild: Why Your .NET Microservice Isn’t Running What You Think
While working in a fairly large .NET microservice landscape I came across the following assumption-shattering situation, which led me down a nuget-versioning rabbit hole.
Continue reading “Transitive Dependencies Gone Wild: Why Your .NET Microservice Isn’t Running What You Think”Implementing Centralized Package Management
Exploring options for building REST APIs with C# and deploying to Azure
Somebody asked me, what is the difference between a C# REST API running as a Web App on an App Service as a container and a C# REST API running as a HTTP Function on an App Service or a Consumption Plan?
There are lots of aspects in this question, so let’s unpack this a bit first.
First, let’s talk about the various ways we can build REST APIs in .NET.
Then, we’ll talk about how you can deploy these, either as code or as a container.
Last, we’ll explore – if you end up with a container – which Azure service best fits your needs.
You will be assimilated: Microsoft implementations of formerly popular OSS libraries
The below is a summary of all the libraries Nick mentions in his video.
Continue reading “You will be assimilated: Microsoft implementations of formerly popular OSS libraries”Records and Interfaces: Here Be Dragons
When it comes to C# types—classes, structs, and records—understanding the difference between value and reference equality is crucial. Each type behaves differently in terms of equality checks, inheritance, and how they manage their internal state. However, things can get tricky when you introduce interfaces into the mix, particularly when dealing with records.
Continue reading “Records and Interfaces: Here Be Dragons”Smart cleanup of unused references
Say you have a ‘large project’ (think: clean architecture) with 40+ projects that has gradually evolved over time, has been refactored etc. There may be unused references lying around.
Continue reading “Smart cleanup of unused references”Eagerly consuming a collection of completing Tasks
Imagine you start a bunch of files (say, uploading or downloading files big and small) and after the first one completes, you want to do something else — how do you await
that first task?
Optimal usage of Global Usings
I have a solution with ~40 projects, built during many years with wild usings that I wanted to clean up. The global usings
feature, introduced in with C# 10.0 and .NET 6 (nov21) to simplify and reduce the repetition of commonly used namespaces throughout a project.
The question I have is, how do I ‘get’ the most commonly used namespaces and how do I do that at scale.
Continue reading “Optimal usage of Global Usings”