Andrew Lock "Sock"
banner
andrewlock.bsky.social
Andrew Lock "Sock"
@andrewlock.bsky.social
Microsoft MVP and blogger, focused on ASP.​NET Core. Author of ASP.​NET Core in Action (https://mng.bz/5mRz)

Blog: https://andrewlock.net
Mastadon: @[email protected]
Twitter: @andrewlocknet
Reposted by Andrew Lock "Sock"
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.
February 4, 2026 at 7:58 PM
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
Exploring the (underwhelming) System.Diagnostics.Metrics source generators: System.Diagnostics.Metrics APIs - Part 2
In this post I explore the source generators shipped in Microsoft.Extensions.Telemetry.Abstractions, explore the code, and discuss whether I would use them
andrewlock.net
February 3, 2026 at 6:10 PM
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
February 3, 2026 at 10:16 AM
Reposted by Andrew Lock "Sock"
Speed up enum ToString and parsing with @andrewlock.bsky.social's latest NetEscapades.EnumGenerators update: disable number parsing, serialize in lower or upper invariant, and get span support via System.Memory on older targets.

#csharp #dotnet
Recent updates to NetEscapades.EnumGenerators: new APIs and System.Memory support
In this post I describe some recent changes to the NetEscapades.EnumGenerators source generator, including support for the System.Memory package and new APIs
andrewlock.net
January 29, 2026 at 3:49 PM
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
Creating and consuming metrics with System.Diagnostics.Metrics APIs
In this post I provide an introduction to the System.Diagnostics.Metrics API, and show how to create a custom metric and read it with dotnet-coutners
andrewlock.net
January 27, 2026 at 3:26 PM
Reposted by Andrew Lock "Sock"
After a long wait, I've finally published the sixth part in my "Writing a .NET Garbage Collector in C#" series. Today, we start implementing mark and sweep.

minidump.net/writing-a-ne...
Writing a .NET Garbage Collector in C#  - Part 6: Mark and Sweep
Using NativeAOT to write a .NET GC in C#. In the sixth part, we start implementing the mark phase of the garbage collection.
minidump.net
January 27, 2026 at 10:26 AM
Reposted by Andrew Lock "Sock"
So I can learn what I need for both a new job and my game, I'm reading the massive ASP.NET Core In Action by @andrewlock.bsky.social. My roommate called it a magical tome and pointed out: there's even a wizard on the cover!

Anyway, now I imagine I'm reading a magical tome for casting complex spells
January 20, 2026 at 2:30 PM
Blogged: Making foreach of an IEnumerable allocation-free, using reflection and dynamic methods

andrewlock.net/making-forea...

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
January 20, 2026 at 4:17 PM
Blogged: The Windows File Explorer replacement, File Pilot, is awesome

andrewlock.net/windows-expl...

In this post I describe my experience with the Windows File Explorer replacement, File Pilot. It's blazingly fast, feature rich, and has hotkeys everywhere
The Windows File Explorer replacement, File Pilot, is awesome
In this post I describe my experience with the Windows File Explorer replacement, File Pilot. It's blazingly fast, feature rich, and has hotkeys everywhere
andrewlock.net
January 13, 2026 at 7:45 PM
Blogged: Recent updates to NetEscapades.EnumGenerators: new APIs and System.Memory support

andrewlock.net/updates-to-n...

In this post I describe some recent changes to the NetEscapades.EnumGenerators source generator, including support for the System.Memory package and new APIs

#dotnet
Recent updates to NetEscapades.EnumGenerators: new APIs and System.Memory support
In this post I describe some recent changes to the NetEscapades.EnumGenerators source generator, including support for the System.Memory package and new APIs
andrewlock.net
January 6, 2026 at 4:01 PM
Reposted by Andrew Lock "Sock"
HeroDevs has joined Microsoft, Canonical, and Red Hat as a member of the .NET Security Group www.herodevs.com/blog-posts/h...
HeroDevs Blog | HeroDevs Joins .NET Security Group: Securing the Future of the .NET Ecosystem
HeroDevs joins the .NET Security Group alongside Microsoft, Red Hat, and Canonical to deliver synchronized CVE patches and stronger security for end-of-life .NET systems.
www.herodevs.com
January 6, 2026 at 12:58 AM
Reposted by Andrew Lock "Sock"
The new Spectre.Console (and Spectre.Console.Cli) website is now live! 🎉

This is all courtesy of @philco.bsky.social, who has done an amazing job, just as he did with the previous website.

spectreconsole.net
Spectre.Console Documentation
Documentation for Spectre.Console and Spectre.CLI - rich console UI library and command-line application framework for .NET
spectreconsole.net
December 24, 2025 at 6:43 PM
Reposted by Andrew Lock "Sock"
December 20, 2025 at 11:36 AM
Reposted by Andrew Lock "Sock"
Today I ran into a deadlock in VS2026. I debugged it, and it turned out to be a common issue you may run into when writing a profiler.
I wrote a short article about it: minidump.net/investigatin...
Investigating a deadlock in Visual Studio
A short investigation that showcases one of the most common problem faced when writing a profiler.
minidump.net
December 17, 2025 at 5:55 PM
Reposted by Andrew Lock "Sock"
Creating a .NET CLR profiler using C# and NativeAOT with Silhouette | by Andrew Lock

buff.ly/8dnlOXH

#dotnet #programming #csharp #profiler #aot
Creating a .NET CLR profiler using C# and NativeAOT with Silhouette
In this post I look at how to create a simple .NET profiler. But instead of using C++, the profiler uses C# and NativeAOT with the Silhouette library
buff.ly
December 16, 2025 at 7:00 PM
Blogged: Creating a .NET CLR profiler using C# and NativeAOT with Silhouette

andrewlock.net/creating-a-d...

In this post I look at how to create a simple .NET profiler. But instead of using C++, the profiler uses C# and NativeAOT with @kevingosse.net's Silhouette library

#dotnet
Creating a .NET CLR profiler using C# and NativeAOT with Silhouette
In this post I look at how to create a simple .NET profiler. But instead of using C++, the profiler uses C# and NativeAOT with the Silhouette library
andrewlock.net
December 16, 2025 at 6:10 PM
Blogged: Trying out the Zed editor on Windows for .NET and Markdown

andrewlock.net/trying-out-t...

In this post I try out Zed on Windows to see if it can replace my VS Code usages for quick edits of .NET projects and writing Markdown documents.

#dotnet
Trying out the Zed editor on Windows for .NET and Markdown
In this post I try out Zed on Windows to see if it can replace my VS Code usages for quick edits of .NET projects and writing Markdown documents
andrewlock.net
December 9, 2025 at 6:30 PM
Reposted by Andrew Lock "Sock"
Blogged: Recent updates to NetEscapades.EnumGenerators: [EnumMember] support, analyzers, and bug fixes

andrewlock.net/recent-updat...

In this post I describe some recent changes to the NetEscapades.EnumGenerators source generator, including support for [EnumMember] and new analyzers

#dotnet
Recent updates to NetEscapades.EnumGenerators: [EnumMember] support, analyzers, and bug fixes
In this post I describe some recent changes to the NetEscapades.EnumGenerators source generator, including support for [EnumMember] and new analyzers
andrewlock.net
December 2, 2025 at 5:05 PM
Reposted by Andrew Lock "Sock"
MSBuild tip: if you're working with binlogs, set the environment variable MSBuildLogPropertyTracking=15.

It enables logging of where each property was initially assigned from during evaluation and lights up more features in the binlog viewer.
December 2, 2025 at 6:13 AM
Reposted by Andrew Lock "Sock"
And it's up! All together now...

🎶 Somebody told me
the user provider
should use an adaptor
to proxy the query
factory builder... 🎶

www.youtube.com/watch?v=p03o...
November 28, 2025 at 3:15 PM
Blogged: Exploring the .NET boot process via host tracing

andrewlock.net/exploring-th...

In this post we enable host tracing and use that to understand how a .NET app boots up via the dotnet muxer, hostfxr, and hostpolicy.dll

#dotnet
Exploring the .NET boot process via host tracing
In this post we enable host tracing and use that to understand how a .NET app boots up via the dotnet muxer, hostfxr, and hostpolicy.dll
andrewlock.net
November 25, 2025 at 6:39 PM