RSSAmplifier

Blog

Andrew Lock | .NET Escapades

Hi, my name is Andrew, or ‘Sock’ to most people. This blog is where I share my experiences as I journey into ASP.NET Core.

andrewlock.netRSS feed ↗25 posts

Latest posts

Automatic CSRF protection based on Fetch Metadata headers: Exploring the .NET 11 preview - Part 6

In this post I describe the new Cross-Site Request Forgery protection added to ASP.NET Core that uses Fetch Metadata HTTP headers instead of antiforgery tokens

Understanding the Fetch Metadata HTTP headers: Sec-Fetch-Site and friends

In this post I describe the Fetch Metadata HTTP headers like Sec-Fetch-Site and Sec-Fetch-Mode which give information to a server about the context of a request

Improvements to reading Process outputs: Exploring the .NET 11 preview - Part 5

In this post I show some of the improvements to the Process API in .NET 11 for running processes and reading their outputs without risk of deadlock

Closed class hierarchies: Exploring the .NET 11 preview - Part 4

In this post I describe what a close closed hierarchy is, how to create one, and discuss why you might want to

Avoiding ToString() allocations with StringBuilder.MoveChunks: Exploring the .NET 11 preview - Part 3

In this post I take a short look at the new MoveChunks API, explore how it works, what it's for, and how the new API provides opportunities for public APIs

.NET (OK, C#) finally gets union types🎉: Exploring the .NET 11 preview - Part 2

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

Running background tasks in Blazor with Web Workers: Exploring the .NET 11 preview - Part 1

In this post I discuss the new Web Worker template available in .NET 11 for running CPU intensive tasks without blocking the UI

New features in Git 2.54: easier rebasing, hooks, and statistics

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

Removing byte[] allocations in .NET Framework using ReadOnlySpan<T>

In this post I describe how to remove static byte[] allocations, even on .NET Framework, by using Span , look at the associated IL, and discuss the risks

Running AI agents with customized templates using docker sandbox

In this post I describe how to create custom templates for Docker Sandboxes, so that your sandboxes start with additional tools immediately available

Running AI agents safely in a microVM using docker sandbox

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

Configuring contextual options with Microsoft.Extensions.Options.Contextual

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 whether to use it or not

Splitting the NetEscapades.EnumGenerators packages: the road to a stable release

In this post I describe the recent architectural changes to the NetEscapades.EnumGenerators package, which is now a metapackage, to support more scenarios

Recording metrics in-process using MeterListener: System.Diagnostics.Metrics APIs - Part 4

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.

Creating standard and "observable" instruments: System.Diagnostics.Metrics APIs - Part 3

In this post I discuss the various Instrument types exposed by the System.Diagnostics.Metrics API and show examples from the .NET libraries and ASP.NET Core

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

Creating and consuming metrics with System.Diagnostics.Metrics APIs: System.Diagnostics.Metrics APIs - Part 1

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-counters

Making foreach on an IEnumerable allocation-free using reflection and dynamic methods

In this post I describe why foreach sometimes allocates, and show how you can use DynamicMethod and Reflection.Emit to go allocation-free

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

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

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

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

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

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

Companies complaining .NET moves too fast should just pay for post-EOL support

In this post I describe a solution to .NET "releasing too quickly": just pay for support of older versions, such as HeroDevs' Never Ending Support for .NET 6