Zstandard compression in .NET 11
.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.
Hey, I'm Steven a .NET Developer in Switzerland. I am a Microsoft MVP. Also, this blog is open source on GitHub.
.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!