Blogged: .NET finally gets union types🎉 - Exploring the .NET 11 preview - Part 2
andrewlock.net/exploring-the…
In this post I discuss the support for union types released in .NET 11, how they're implemented, the choices made, and how to create your own union types
#dotnet#csharp
Blogged: Running background tasks in Blazor with Web Workers - Exploring the .NET 11 preview - Part 1
andrewlock.net/exploring-the…
In this post I discuss the new Web Worker template available in .NET 11 for running CPU intensive tasks without blocking the UI
#dotnet#blazor
Better C#/.NET systems don’t come from features alone.
Julio Quezada's five-book "reading sprint" focuses on clear separation of concerns, lightweight dependencies, and systems that remain reliable under stress.
Includes:
• ASP. Net Core in Action, 3rd ed by @andrewlocknet: hubs.la/Q04dX7yP0
• Dependency Injection Principles, Practices, and Patterns by @dot_NET_Junkie and @ploeh: hubs.la/Q04dWZyQ0
Full list: hubs.la/Q04dWZYh0
Less allocation means better performance. Simple as that. 😎
But how do you actually get there, especially on older runtimes?
@andrewlocknet walks through a practical way to cut byte[] allocations using ReadOnlySpan<T>.
Dive in: prgress.co/4ufch5c
Blogged: New features in Git 2.54: easier rebasing, hooks, and statistics
andrewlock.net/new-features-…
In this post I show some of the new features in Git 2.54 including simple rebases with git history, config-based hooks, and stats with git repo structure
#git
Blogged: Removing byte[] allocations in .NET Framework using ReadOnlySpan<T>
andrewlock.net/removingbyte-…
In this post I describe how to remove static byte[] allocations, even on .NET Framework, by using Span<T> look at the associated IL, and discuss the potential risks
#dotnet
Blogged: Running AI agents with customized templates using docker sandbox
andrewlock.net/running-ai-ag…
In this post I describe how to create custom templates for Docker Sandboxes, so that your sandboxes start with additional tools immediately available (like .NET)
#docker#dotnet
Blogged: Running AI agents safely in a microVM using docker sandbox
andrewlock.net/running-ai-ag…
In this post I show how to run AI coding agents safely while still using YOLO/dangerous mode using docker sandboxes and the sbx tool
#ai#docker#ClaudeCode
Blogged: Configuring contextual options with Microsoft.Extensions.Options.Contextual
andrewlock.net/configuring-c…
In this post I take a brief look at the Microsoft.Extensions.Options.Contextual package to understand what it's for, how to use it, and decide whether to use it
#dotnet
Blogged: Splitting the NetEscapades.EnumGenerators packages: the road to a stable release
andrewlock.net/splitting-the…
In this post I describe the recent architectural changes to the NetEscapades.EnumGenerators package, which is now a metapackage, to support more scenarios
#dotnet
Blogged: Recording metrics in-process using MeterListener
andrewlock.net/recording-met…
In this post I show how you can use MeterListener to listen to Instrument measurements, how to trigger Observable measurements, and how to aggregate values
#dotnet#observability
Sometimes the best takeaway from a source generator review is that the underlying API is already well designed. If the manual code is simple and performant, maybe a generator isn't needed. Good analysis from @andrewlocknet on #dotnet metrics andrewlock.net/creating-stro…
#dotnet has had built in metrics APIs since .NET 6, but many teams still aren't using them for custom application or business metrics. This post by @andrewlocknet covers what's available and how to get started with System.Diagnostics.Metrics andrewlock.net/creating-and-…
Blogged: Creating standard and "observable" instruments
andrewlock.net/creating-stan…
In this post I discuss the various Instrument<T> types exposed by the System.Diagnostics.Metrics API and show examples from the .NET libraries and ASP .NET Core
#dotnet#observability
Blogged: Exploring the (underwhelming) System.Diagnostics.Metrics source generators
andrewlock.net/creating-stro…
In this post I explore the source generators shipped in Microsoft.Extensions.Telemetry.Abstractions, explore the code, and discuss whether I would use them
#dotnet
Blogged: Creating and consuming metrics with System.Diagnostics.Metrics APIs
andrewlock.net/creating-and-…
In this post I provide an introduction to the System.Diagnostics.Metrics API, show how to create a custom metric, and show how to read it with dotnet-counters
#dotnet
Blogged: Making foreach of an IEnumerable allocation-free, using reflection and dynamic methods
andrewlock.net/making-foreac…
In this post I describe why foreach sometimes allocates, and show how you can use DynamicMethod and Reflection.Emit to go allocation-free
#dotnet#csharp