Joined May 2016
136 Photos and videos
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
9
26
161
12,655
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
20
86
5,036
Andrew Lock "Sock" retweeted
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
7
53
2,559
Andrew Lock "Sock" retweeted
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
2
9
1,394
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
11
52
3,890
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
2
17
96
7,321
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
1
4
29
2,298
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
1
3
36
2,744
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
2
7
48
5,247
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
4
14
1,332
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
4
35
2,849
Andrew Lock "Sock" retweeted
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…
1
5
889
Andrew Lock "Sock" retweeted
#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-…
3
11
1,279
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
1
24
3,087
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
8
42
3,254
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
6
10
50
3,313
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
3
8
38
3,169