Implementing RFC-compliant HTTP caching for HttpClient in .NET

 
 
  • Gérald Barré
HTTP caching is one of the most effective ways to improve application performance by reducing network traffic, minimizing server load, and decreasing response times. While browsers automatically implement HTTP caching, the same isn't true for HttpClient in .NET, which processes every request independently without built-in caching support. In this post, I'll show you how to add standards-compliant HTTP… [read more]

Visualize GitHub Actions runs with Meziantou.GitHubActionsTracing

 
 
  • Gérald Barré
I recently released Meziantou.GitHubActionsTracing, a tool that converts GitHub Actions workflow runs into trace data. In this post, I show how to use it to debug slow or flaky CI pipelines with timeline-based analysis instead of raw logs only. Why GitHub Actions runs are hard to diagnose GitHub Actions logs are great for understanding what happened, but not for quickly seeing where time is spent. When a… [read more]

Creating case-sensitive folders on Windows using C#

 
 
  • Gérald Barré
Windows has supported case-sensitive file operations for a long time, but it was not easily accessible or enabled by default. Since Windows 10 (version 1803), it is possible to enable case sensitivity on a per-directory basis. This feature was introduced primarily to support the Windows Subsystem for Linux (WSL), but it can be used by any application. In this post, we'll see how to enable case sensitivity… [read more]

Reserved filenames on Windows (CON, PRN, AUX, NUL...)

 
 
  • Gérald Barré
Windows has a set of reserved filenames that cannot be used for files or folders. These names are reserved for legacy reasons, dating back to DOS. If you try to create a file or folder with one of these names, you will get an error. The list of reserved names is: CON, PRN, AUX, NUL COM0 through COM9 LPT0 through LPT9 These names come from DOS, where devices were exposed as special file-like names. For… [read more]

Validating PowerShell script syntax in GitHub Actions workflows

 
 
  • Gérald Barré
When writing GitHub Actions workflows, it is generally recommended to keep your scripts in separate files and reference them using the path attribute of the run step. This allows you to lint and test your scripts easily using standard tools. However, this approach is not always practical. For instance, when creating a reusable workflow or a simple action, you might prefer to keep everything in a single… [read more]

Getting more information in MSBuild binlogs with property tracking

 
 
  • Gérald Barré
MSBuild binary logs (binlogs) are a powerful tool for diagnosing build issues. If you're not familiar with binlogs, check out my post Exploring a MSBuild binary log using the binary log viewer to get started, or Stop using diagnostic verbosity in MSBuild to understand why binlogs are better than diagnostic verbosity. By default, binlogs capture a lot of information, but you can get even more details about… [read more]

Retrieve method source file location at runtime using Portable PDBs in .NET

 
 
  • Gérald Barré
When debugging or logging, you often need to know where a method is defined in your source code. While .NET provides caller information attributes like [CallerMemberName], [CallerFilePath], and [CallerLineNumber], these only work at compile-time and require you to add parameters to your methods. What if you want to retrieve source file information for any method at runtime? One use-case is… [read more]