Posts by Andrew Lock "Sock"
Blogged: Running AI agents with customized templates using docker sandbox
andrewlock.net/running-ai-a...
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-a...
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 #sandbox #claude
New issue of .NET R&D Digest is here! Thx to
@simonwillison.net, @birgitta410.bsky.social, @kief.com, @lemire.bsky.social, @kevingosse.net, @andrewlock.bsky.social, @meziantou.net, @stevesanderson.bsky.social & other authors for their g8 content!
#dotnet
olegkarasik.wordpress.com/2026/04/03/n...
Blogged: Configuring contextual options with Microsoft.Extensions.Options.Contextual
andrewlock.net/configuring-...
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 discuss whether to use it or not
#dotnet
screenshot of the main page of File Pilot project website at https://filepilot.tech/
I can hardly believe that (finally!) there is a great file explorer alternative for those of us who have to stick with windows -- File Pilot is absolutely sleek and marvelous 😍
🔗 filepilot.tech
ht @andrewlock.bsky.social (andrewlock.net/windows-expl...)
Yeah, I expect it's the same issue tbh, but honestly, I just don't have the strength to fight with it these days 😅 I can watch the videos on demand, but Teams is just inaccessible to me now. Again. 😅 ah well
Classic
Hopefully you'll have more luck than me 😅
Ah good, another virtual MVP Summit and because Microsoft Teams is terrible, I can't watch any of it. Classic 🙄
Announcing Polecat: Event Sourcing with SQL Server jeremydmiller.com/2026/03/22/a...
I'll happily take any RTs please and thank you!
#polecat #critterstack #sqlserver
Want the power of Duende IdentityServer but with faster time-to-value? ⏱️ We’re previewing a first-party user management .NET SDK on March 24th that gives you Passkeys, MFA, and audit trails out-of-the-box. Keep your data control, ditch the custom coding.
RSVP: duende.link/78q3hk
#dotnet #aspnet
Have you ever noticed that a simple .NET Core applications on 64-bit uses more than 2TB of virtual memory?
In a new episode of the series "writing a .NET garbage collector in C#", we discover the kind of problem that it intends to solve: minidump.net/writing-a-ne...
That seems to suggest that this library actually shouldn't be required in MVC at least, as long as you're using IStringLocalizer😅 Need to refresh my memory though...
I'm sure DI was part of it, but I think IStringLocalizer was primarily meant to be "lower overhead" because the "key" can just be the actual phrase: e.g. "This field is required".
However, I also just discovered this post I wrote 9 years ago 😅
andrewlock.net/localising-t...
@damienbod.com, @rufer.be, is this really how you're out there doing localization on MVC/Razor/Blazer apps?! 😅
I wrote something on LinkedIn: www.linkedin.com/posts/psvens...
I'm looking for a new gig and/or employment (if interesting enough). Please repost if you can! Much appreciated!
This looks like a nice clean solution to a wart on .NET's localization functionality - using Fody to set a default ErrorMessageResourceType and ErrorMessageResourceName (based on the attribute type).
github.com/mrpmorris/Au...
Seems crazy that this is necessary though - am I missing something?!
Blogged: Splitting the NetEscapades.EnumGenerators packages: the road to a stable release
andrewlock.net/splitting-th...
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-me...
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
I got "tricked" by PerfView when using it to measure the effectiveness of my optimizations, so I decided to write about it: minidump.net/an-unexpecte...
It's not specific to PerfView though, in theory this could happen with any profiler.
Ok, so I wrote a very long and kinda personal thing about existential dread and the end of programming, and I'm not really sure I want to endure the discourse, but if you want to read it, it's here - gist.github.com/davidwhitney...
It's like 6,000 words long, sorry.
Thanks!
Blogged: Creating standard and "observable" instruments
andrewlock.net/creating-sta...
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: Add application security to the swiyu generic management verifier APIs using OAuth
damienbod.com/2026/02/16/a...
#aspnetcore #oauth #swiyu #swiss #openid #yarp #aspire #container #api #iam #security #dotnet
Scrolling list of ASP.NET log output
Show all the routes of a site
Show all the configuration values for an ASP.NET site and their source
Shows the DI configuration
If you didn't catch it, this shows the current logs, DI config, environment and ASP.NET routes in the terminal when you do a dotnet run on an ASP.NET app. Combines a bunch of snippets I've borrowed from @meziantou.net and @andrewlock.bsky.social posts and dumping them into the console.
In this case "better" is just "more like the original source" ☺️ e.g. dotpeek has two nested for loops like the original, where ilspy has a for and a while.
ILSpy pita the label in the right place though 😅
Blogged: Exploring the (underwhelming) System.Diagnostics.Metrics source generators
andrewlock.net/creating-str...
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
And thanks to friends in high places (cough @kevingosse.net):
youtrack.jetbrains.com/issue/DOTP-8...
The source code for MemoryExtensions.TrimEnd, showing the 'Next' label after the break
The source code for the ILSpy-decompiled version, which uses an inner while loop, but contains the IL_0044 (Next) label at the right place
The source code for the dotPeek-decompiled version, which uses an inner while loop, but contains the label_8 (Next) label in the _wrong_ place
We discovered something interesting... the decompiled output of ILSpy and dotPeek differs. Which is fine...dotPeek does a "better" job in general... except that in this case, the dotPeek code includes an infinite loop bug 😅
1) Original source for MemoryExtensions.TrimEnd()
2) ILSpy
3) dotPeek