.NET Toolbox August Update
Quite some time passed since I posted a changelog to the .NET Toolbox . And there are big news: The Toolbox is running dotnet native in the browser thanks to wasm and Mono!
Hey, I'm Steven a .NET Developer in Switzerland. I am a Microsoft MVP. Also, this blog is open source on GitHub.
Quite some time passed since I posted a changelog to the .NET Toolbox . And there are big news: The Toolbox is running dotnet native in the browser thanks to wasm and Mono!
As always my yearly take on the latest .NET release. In a few months dotnet 11 will be released and I wanted to have a look into some performance metrics.
Here a simple scenario: You have a StringComparer and you want to add your own comparer to the mix - for example a "natural sort" order, so "file2" sorts before "file10" instead of after. With C# 14 we can extend the family and make it feel natural!
Blazor is a bit talkative when it comes to the Developer Console. PageSpeed Insights for example does complain: Browser errors were logged to the console The fix is easy.
LinkedIn: The "professional" network where critical thinking takes a backseat and everyone is an expert in everything.
Signals - more often used in Angular - are a nice way to tell the UI that something has changed. Blazor doesn't have that natively, but how would it look, if it did?
If you use AsSplitQuery anywhere in your codebase, EF Core 11 has a present for you: your queries get faster.
.NET has had DeflateStream , GZipStream , ZLibStream , and BrotliStream for a while now. In .NET 11, a new one joins the party: ZstandardStream . And now we get to say "Zstd" in .NET.
Here's a bug that lived in .NET for over four years As in: Reported over 4 years ago . If your BackgroundService threw an exception after its first await , your host would catch it, log a critical message, and then exit cleanly with exit code 0 . So everyone would think it terminated successfully. That got fixed!
Microsoft.Extensions.Configuration has had ConfigurationKeyNameAttribute since .NET 6 which it lets you rename the key a property maps to. But there was never an official way to say "don't bind this property at all." That gap is finally closed in .NET 11 with ConfigurationIgnoreAttribute .
Some time ago (over 4.5 years ago!) I wrote a blog post titled: "A better enumeration - Type safe from start to end" . While cool and so - it had some issues. Let's tackle them!
What is the output of that code snippet? Console.Write(new Derived("Test")); public abstract record Base(string Key) { public override string ToString() => Key; } public sealed record DerivedRecord(string Key) : Base(Key); Probably "Test" ?
We have Join . We have LeftJoin . We have RightJoin . But somehow we still don't have a proper full outer join in LINQ. That might come soon!
I am using a tool called Handy, which is basically nothing else than speech to text. But it does it so well that I thought, okay, let's give it some broader audience.
Sometimes doing arbitrary stuff feels just good! So let's do that!
Some time back I wrote about "async2 - The .NET Runtime Async experiment concludes" basically moving the async state machine into the runtime. Now with .NET 11 we are seeing the fruits of that labor.
The first preview of .NET 11 and C# 15 did just release. Some weeks back I did add already an article about that: "Collection Expression Arguments in C# 15+" . Well quicker than anticipated that feature is now part of it!
In Dezember 2025 and January 26 I created a small helper tool: the .NET Toolbox . I also made a post about, if you wanna be "up to speed": ".NET Toolbox" . I did some bug fixes and updates.
I came across a recent thing, where I hit the limit with the "normal" approach of modeling my entity and had to resort to extension methods.
There is a nice proposal which would make collection expressions a bit better - Giving the users the ability to pass in arguments to the creation.
Let's start the new year with a bang: I created a new tool called "Toolbox" to offer some helpful tools for your everyday .NET life. Totally free, open-source and everything client-side!
Task.Delay fails if you wait longer than 49.7 days. So something like: await Task.Delay(TimeSpan.FromDays(50)); will fail. But why and should you care?
Short question, and a short answer: ToListAsync - but why?
I saw mutliple places where people use GitHub runners to do some benchmarking. That can be a tricky thing to do.
New helper will be available with .NET 11: MediaTypeMap.GetMediaType and MediaTypeMap.GetExtension which makes the web-development a bit easier!
.NET 9 introduced Guid.CreateVersion7() / Guid.CreateVersion7(DateTimeOffset) methods to create sortable UUIDs / GUIDs based on the time of their creation. This can be particularly useful in databases where you want to maintain a chronological order of records (plus some perf benefits). Currently, there is no native way to configure Entity Framework to use these methods when generating new GUIDs…
If you are using API Tests with the WebApplicationFactory you might did something like this to have a public Program class: public partial class Program; No more!
In xUnit v2 ITraceOutputHelper was needed (and injected) to make the console output inside your production code visible inside a test - in v3 it is easier: CaptureConsoleAttribute
Many benchmarks that are using ArrayPool , or more specificly ArryPool<T>.Shared , are not actually measuring a "real" scenarion or the benchmark is flawed in some way. Let's examine a bit on what is going on.
You need some advice around Random ? Sure there is something on LinkedIn for that. Let's have a look.
In this - somewhat technical and barely usable - blog post, we will have a look at inlining and structs in C#. And how they can optimize performance in some interesting ways.
This is a very small blog post on why you should use CancellationToken s in your API.
Another day, another dollar. LinkedIn has the tips for you! Performance, performance! Let's get right into it.
In Entity Framework Core ToDictionaryAsync (and of course) also the the synchronous counter part ToDictionary retrieve the whole object from the database.
For a lack of a better title, this blog post shows a database improvement that helped me quite a bit and what to do to make it work.
Did you ever wonder if there is a noticeable difference between: List<int> a = [1, 2, 3]; // And List<int> b = new() {1,2,3}; Let's find out:
The preview 6 of dotnet 10 brings two more functions: InfiniteSequence and Sequence .
Entity Frameworks SqlRaw has a small, sometimes annoying limitation : The SQL query must return data for all properties of the entity type. Sometimes that isn't desireable, so let's overcome that super easy.
In this blog post we will have a look into how to disable the thread safety check in Entity Framework. What are the implications of doing so and how to do it.
Architectural Unit tests are nice to constraint your system (like which parts of your application can access other parts of your application). This blog post is not about that - that is covered a lot in the internet. No, I want to show what I did in a recent project: Checking if all controllers do use CancellationToken and some other entities are sealed .
Some while ago I was explaining what "Lowering" is. And the interesting part is that List behaves differently like an array while also a List is backed by an array. But why?
Last year I wrote an article about how ToListAsync was slow in Entity Framework titled: "Be careful with ToListAsync and ToArrayAsync in Entity Framework Core" . Things have evolved since then, so let's celebrate!
Often times, you find yourself in writing data-driven tests in xUnit (like Theory tests) and you want to add a description to each test case. Let's explore how to do that.
Did you ever try to have a switch expression in Blazor? Yes, and did it go well? Sometimes not. Let's see why!
As every year, the dotnet team adjusted the runtime and libraries to improve performance. So let's go over some of the highlights. I will link the corresponding blog post or GitHub issue for each item, so you can read more about it if you are interested. And of course: You will find the benchmarks at the end of the article.
If you want to be up to date with dotnet development, you can obviously follow the official blogs from Microsoft and release notes. But what if you want to pick into the future or smaller details that aren't released or covered? Then let's go to GitHub!
If we have a List<T> and an IList<T> , enumerating over the List<T> is faster than enumerating over the IList<T> . Why is that?
For good reasons, many folks don't want to use reflection . Since .NET 8, we have a better way of dealing with this in most of the cases (when known in advance). But we can go the opposite: Make it even unsafer for a tiny bit performance!
In C# we have many nice guards sitting on top of static exceptions classes like ArgumentNullException , ArgumentOutOfRangeException , etc: As ArgumentException.ThrowIfNullOrEmpty , ArgumentException.ThrowIfNullOrWhiteSpace . Now we can extend them easily!
NuGet can cache a lot of packages and other stuffs over time. Here a small rundown on how to clear the biggest chunk.