Content by Andrew Lock (49)
Andrew Lock explains how to build and publish custom Docker Sandbox templates so AI-agent sandboxes start with the tooling you need, including an example that installs the .NET SDK and a more advanced approach that swaps the base image while reapplying the sandbox layering.
Andrew Lock explains how to run AI coding agents in Docker Sandboxes using the sbx tool, so you can use “dangerous”/YOLO-style agent modes while keeping your host machine isolated, with practical setup steps, network policy notes, and git workflow tips.
Andrew Lock walks through what Microsoft.Extensions.Options.Contextual is, how to wire it up in an ASP.NET Core app (including its source generator and receiver pattern), and why he considers it experimental and usually not worth adopting compared to established feature-flag approaches.
Andrew Lock explains recent architectural changes to the NetEscapades.EnumGenerators package family, guiding .NET developers on choosing the right flavor for their scenario and sharing lessons from evolving the popular source generator library.
Andrew Lock explores how to collect and process application metrics in .NET using MeterListener from System.Diagnostics.Metrics. He explains the MetricManager pattern, in-process aggregation, and visualizing metrics with Spectre.Console.
Andrew Lock provides a deep dive into the various instrument types featured in the System.Diagnostics.Metrics API. The article explores practical examples from .NET libraries and ASP.NET Core to illustrate how developers can record and observe metrics in their applications.
Andrew Lock provides a comprehensive walkthrough on leveraging System.Diagnostics.Metrics APIs in .NET, guiding developers through instrumentation concepts, monitoring with dotnet-counters, and building custom metrics for production-grade observability.
Andrew Lock explains how to make foreach iteration allocation-free on IEnumerable in .NET, leveraging Reflection.Emit and DynamicMethod for advanced memory optimization, with benchmarks and implications for earlier and modern .NET runtimes.
Andrew Lock summarizes recent improvements to the NetEscapades.EnumGenerators package, including new APIs, advanced parsing options, and System.Memory support, offering insights for .NET developers seeking faster enum operations.
Andrew Lock demonstrates how to create a simple .NET CLR profiler using C# and NativeAOT with the Silhouette library, showing how to hook into assembly load events for custom profiling.
Andrew Lock explores whether the Zed editor on Windows can replace VS Code for .NET and Markdown editing, sharing his installation experience, setup tips, feature comparisons, and impressions.
Andrew Lock explains the recent improvements to NetEscapades.EnumGenerators, a .NET source generator package, including support for [EnumMember], additional analyzers, and bug fixes. Developers gain new metadata options and guidance on edge cases.
Andrew Lock provides a technical walkthrough exploring .NET's boot process using host tracing, offering developers step-by-step insights into muxer, hostfxr, and hostpolicy.dll components.
Andrew Lock reviews the .NET support lifecycle and demonstrates how organizations can avoid risks from unsupported versions by leveraging HeroDevs' Never Ending Support for .NET 6.
Andrew Lock demonstrates improvements to the [UnsafeAccessor] mechanism in .NET 10, focusing on how [UnsafeAccessorType] enables accessing private fields and methods for types without direct references.
Andrew Lock provides an in-depth technical breakdown of the ASP.NET Core CVE-2025-55315 vulnerability, explaining request smuggling, exploitation avenues, and steps for developers to remain secure.
Andrew Lock delves into the quirks of applying metadata to fallback endpoints in ASP.NET Core, providing guidance on best practices for minimal APIs, MVC, and Razor Pages.
Andrew Lock walks through using nuget.org’s Trusted Publishing to publish NuGet packages from a GitHub Actions workflow without storing long-lived API keys, using OIDC token exchange and a nuget.org trust policy to improve publishing security.
Andrew Lock details the development of 'sleep-pc,' a native AOT .NET tool for putting Windows PCs to sleep after a timeout, highlighting his approach, toolchain choices, and packaging for NuGet.
Andrew Lock provides a thorough guide on leveraging the new .NET 10 platform-specific tool features, highlighting technical strategies and trade-offs for maintaining compatibility with older .NET SDKs.