Gérald Barré's Avatar

Gérald Barré

@meziantou.net

Microsoft MVP, Software engineer, blogger https://www.meziantou.net/

213
Followers
95
Following
46
Posts
28.07.2023
Joined
Posts Following

Latest posts by Gérald Barré @meziantou.net

Preview
Creating case-sensitive folders on Windows using C# - Gérald Barré Learn how to enable per-directory case sensitivity on Windows using C# and P/Invoke. Create files with the same name but different case in the same folder.

Creating case-sensitive folders on Windows using C# #dotnet #windows https://www.meziantou.net/creating-case-sensitive-folders-on-windows-using-csharp.htm?utm_medium=social&utm_source=bluesky

03.03.2026 14:43 👍 2 🔁 0 💬 0 📌 0
Preview
Validating PowerShell script syntax in GitHub Actions workflows - Gérald Barré Learn how to validate the syntax of PowerShell scripts embedded in GitHub Actions workflows using a custom PowerShell function.

Validating PowerShell script syntax in GitHub Actions workflows #github #powershell https://www.meziantou.net/validating-powershell-script-syntax-in-github-actions-workflows.htm?utm_medium=social&utm_source=bluesky

17.02.2026 14:43 👍 1 🔁 0 💬 1 📌 0
Preview
Getting more information in MSBuild binlogs with property tracking - Gérald Barré Learn how to enable MSBuild property tracking to get detailed information about property changes in your build logs.

Getting more information in MSBuild binlogs with property tracking #dotnet #msbuild https://www.meziantou.net/getting-more-information-in-msbuild-binlogs-with-property-tracking.htm?utm_medium=social&utm_source=bluesky

10.02.2026 14:47 👍 0 🔁 0 💬 1 📌 0
Preview
Retrieve method source file location at runtime using Portable PDBs in .NET - Gérald Barré Learn how to retrieve the source file path and line number for any method at runtime using Portable PDBs in .NET.

Retrieve method source file location at runtime using Portable PDBs in .NET #dotnet #msbuild https://www.meziantou.net/retrieve-method-source-file-location-at-runtime-using-portable-pdbs-in-dotnet.htm?utm_medium=social&utm_source=bluesky

20.01.2026 14:41 👍 4 🔁 0 💬 1 📌 0
Preview
Reduce GitHub Actions runner CPU usage - Gérald Barré In this post, I'll show you how to reduce the CPU usage of your self-hosted GitHub Actions runners by replacing the default busy-waiting sleep implementation with a more efficient one.

Reduce GitHub Actions runner CPU usage https://www.meziantou.net/reduce-github-actions-runner-cpu-usage.htm?utm_medium=social&utm_source=bluesky

30.12.2025 14:36 👍 3 🔁 0 💬 0 📌 0
Preview
Understanding and Managing Mark of the Web in .NET - Gérald Barré In this post, I describe how to read, set, and remove the Mark of the Web security feature in Windows using .NET.

Understanding and Managing Mark of the Web in .NET #dotnet #security #windows https://www.meziantou.net/understanding-and-managing-mark-of-the-web-in-dotnet.htm?utm_medium=social&utm_source=bluesky

23.12.2025 14:36 👍 2 🔁 0 💬 0 📌 0

Renovate can handle updates of MSBuild SDKs

09.12.2025 16:52 👍 0 🔁 0 💬 1 📌 0
Preview
Creating a custom MSBuild SDK to reduce boilerplate in .NET projects - Gérald Barré Learn how to create custom MSBuild SDKs to enforce coding standards, add packages dynamically, and configure .NET projects consistently.

Creating a custom MSBuild SDK to reduce boilerplate in .NET projects #dotnet https://www.meziantou.net/creating-a-custom-msbuild-sdk-to-reduce-boilerplate-in-dotnet-projects.htm?utm_medium=social&utm_source=bluesky

03.12.2025 14:37 👍 6 🔁 1 💬 2 📌 0
Preview
C# 14 Extension Members: Enhancing Polyfill Libraries - Gérald Barré Discover how C# 14 extension members extend beyond instance methods to include properties and static methods, enabling more comprehensive polyfill libraries.

C# 14 Extension Members: Enhancing Polyfill Libraries #dotnet https://www.meziantou.net/csharp-14-extension-members-enhancing-polyfill-libraries.htm?utm_medium=social&utm_source=bluesky

11.11.2025 14:35 👍 0 🔁 0 💬 0 📌 0

Don't forget the leap second...

02.11.2025 03:15 👍 1 🔁 0 💬 0 📌 0
Preview
Thread-Safe Initialization with LazyInitializer - Gérald Barré Learn how to use LazyInitializer.EnsureInitialized for thread-safe initialization in .NET as an alternative to Lazy<T> class.

Thread-Safe Initialization with LazyInitializer #dotnet https://www.meziantou.net/thread-safe-initialization-with-lazyinitializer.htm?utm_medium=social&utm_source=bluesky

21.10.2025 14:33 👍 1 🔁 0 💬 0 📌 0
Preview
Understanding When Type.FullName Returns Null in .NET - Gérald Barré Learn about the specific scenarios in .NET where Type.FullName returns null, including generic types with open parameters and function pointers.

Understanding When Type.FullName Returns Null in .NET #dotnet https://www.meziantou.net/understanding-when-type-fullname-returns-null-in-dotnet.htm?utm_medium=social&utm_source=bluesky

14.10.2025 14:35 👍 0 🔁 0 💬 0 📌 0
Preview
How to Find an Available Network Port for a server in .NET - Gérald Barré Learn how to find an available network port in .NET using the Socket class. This is useful for server applications, testing, and development tools that need to bind to ports without conflicts.

How to Find an Available Network Port for a server in .NET #dotnet https://www.meziantou.net/how-to-find-an-available-network-port-in-dotnet.htm?utm_medium=social&utm_source=bluesky

07.10.2025 14:35 👍 0 🔁 1 💬 0 📌 0
Preview
Using Git insteadOf to Automatically Replace HTTPS URLs with SSH - Gérald Barré In this post, I describe how to use Git's insteadOf configuration to automatically rewrite HTTPS URLs to SSH URLs for seamless authentication.

Using Git insteadOf to Automatically Replace HTTPS URLs with SSH #git https://www.meziantou.net/using-git-insteadof-to-automatically-replace-https-urls-with-ssh.htm?utm_medium=social&utm_source=bluesky

30.09.2025 14:33 👍 0 🔁 0 💬 0 📌 0
Preview
Batch migrate .sln files to .slnx format across repositories - Gérald Barré Learn how to batch migrate .sln solution files to the new .slnx format across multiple repositories using automated tools.

Batch migrate .sln files to .slnx format across repositories #dotnet https://www.meziantou.net/batch-migrate-sln-files-to-slnx-format-across-repositories.htm?utm_medium=social&utm_source=bluesky

23.09.2025 14:35 👍 3 🔁 0 💬 0 📌 0
Preview
Using Multiple Loopback Addresses for Socket Binding - Gérald Barré Learn how to use multiple loopback addresses beyond 127.0.0.1 for socket binding, allowing multiple services to run on the same port by using different addresses in the 127.0.0.0/8 range for testing and development.

Using Multiple Loopback Addresses for Socket Binding #dotnet https://www.meziantou.net/using-multiple-loopback-addresses-for-socket-binding.htm?utm_medium=social&utm_source=bluesky

02.09.2025 14:35 👍 0 🔁 0 💬 0 📌 0
Preview
Git Worktree: Managing Multiple Working Directories - Gérald Barré Learn how to use Git worktree to manage multiple working directories from a single repository, enabling parallel development workflows.

Git Worktree: Managing Multiple Working Directories #git https://www.meziantou.net/git-worktree-managing-multiple-working-directories.htm?utm_medium=social&utm_source=bluesky

26.08.2025 14:34 👍 2 🔁 0 💬 0 📌 0
Preview
Removing allocations by reducing closure scopes using local variables - Gérald Barré In this post, I describe how to avoid allocations when using closures by scoping captured variables. It provides examples and demonstrates the compiler's code transformation.

Remind me of this post about closures and scope www.meziantou.net/reducing-all...

22.08.2025 20:27 👍 2 🔁 0 💬 1 📌 0
Preview
Accessing Windows Known Folders in C# with SHGetKnownFolderPath - Gérald Barré Learn how to access Windows Known Folders like Downloads and Desktop using SHGetKnownFolderPath API in C# when Environment.GetFolderPath is insufficient.

Accessing Windows Known Folders in C# with SHGetKnownFolderPath #dotnet https://www.meziantou.net/accessing-windows-known-folders-in-csharp-with-shgetknownfolderpath.htm?utm_medium=social&utm_source=bluesky

19.08.2025 14:35 👍 1 🔁 0 💬 1 📌 0

No need to write it yourself. You can use `Microsoft.CodeAnalysis.BannedApiAnalyzers` with `T:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute`

16.08.2025 15:45 👍 2 🔁 0 💬 1 📌 0
Preview
SetWindowDisplayAffinity function (winuser.h) - Win32 apps Stores the display affinity setting in kernel mode on the hWnd associated with the window.

You need to call one win32 method to exclude your windows from Recall and screen capture. Web browsers aren't special kids.
learn.microsoft.com/en-us/window...

.NET example: www.meziantou.net/how-to-exclu...

25.07.2025 13:45 👍 1 🔁 0 💬 1 📌 0
Preview
How to Find Public Symbols That Can Be Internal Using Roslyn - Gérald Barré Learn how to use Roslyn to analyze your .NET solution and identify public symbols that are only used internally and can be safely changed to internal.

How to Find Public Symbols That Can Be Internal Using Roslyn #dotnet #roslyn https://www.meziantou.net/how-to-find-public-symbols-that-can-be-internal-using-roslyn.htm?utm_medium=social&utm_source=bluesky

01.07.2025 14:35 👍 4 🔁 2 💬 1 📌 0
Preview
How to Exclude Your Windows App from Screen Capture and Recall - Gérald Barré Learn how to prevent your Windows app from being captured by screen recording and screenshot tools using SetWindowDisplayAffinity.

How to Exclude Your Windows App from Screen Capture and Recall #dotnet #windows https://www.meziantou.net/how-to-exclude-your-windows-app-from-screen-capture-and-recall.htm?utm_medium=social&utm_source=bluesky

24.06.2025 14:36 👍 0 🔁 0 💬 0 📌 0
Preview
Automatically Rerun Failed GitHub Actions Workflows - Gérald Barré This post explains how to automatically rerun failed GitHub Actions workflows using the workflow_run event and specific conditions.

Automatically Rerun Failed GitHub Actions Workflows #github https://www.meziantou.net/automatically-rerun-failed-github-actions-workflows.htm?utm_medium=social&utm_source=bluesky

17.06.2025 14:36 👍 1 🔁 0 💬 0 📌 0
Preview
Automating Null-Forgiving Operator Removal in C# Projects - Gérald Barré In this post, I describe how to automate the removal of the null-forgiving operator in C# projects using tools like Roslyn and MSBuildWorkspace.

Automating Null-Forgiving Operator Removal in C# Projects #dotnet https://www.meziantou.net/automating-null-forgiving-operator-removal-in-csharp-projects.htm?utm_medium=social&utm_source=bluesky

03.06.2025 14:36 👍 2 🔁 0 💬 1 📌 0
Preview
Use C# 14 extensions to simplify enum Parsing - Gérald Barré Learn how to use C# 14 extensions to simplify enum parsing, making your code more consistent, intuitive, and easier to understand.

Use C# 14 extensions to simplify enum Parsing #dotnet https://www.meziantou.net/use-csharp-14-extensions-to-simplify-enum-parsing.htm?utm_medium=social&utm_source=bluesky

13.05.2025 14:36 👍 4 🔁 1 💬 0 📌 0
Preview
How Workleap uses .NET Aspire to transform local development We built Leap, an opinionated, reliable CLI tool to distribute .NET Aspire to all Workleap developers.

Just dropped a deep‑dive on how we built Leap, an opinionated, reliable CLI tool powered by .NET Aspire to make distributed system development easier for all Workleap developers 🚀.

medium.com/workleap/how...

#dotnet #aspire

12.05.2025 16:55 👍 15 🔁 4 💬 0 📌 2

CS4014 is ok for async methods. If you are in a non-async context, you need an extra analyzer such as github.com/meziantou/Me...

learn.microsoft.com/en-us/dotnet...

18.04.2025 16:00 👍 0 🔁 0 💬 1 📌 0

Notre table ronde d'Avril est disponible en podcast et sur Youtube. Au menu dapr Agent, .NET 10, Aspire 9.2, Typescript en Go et UWP avec .NET 9.
Animé par @anthonysimmon.com, @meziantou.net, @laurentkempe.com, Clément Sannier, Jérémy Jeanson et moi-même #podcast
⬇️⬇️⬇️

09.04.2025 05:39 👍 3 🔁 3 💬 1 📌 0
Preview
Generate PDF files using an html template and Playwright - Gérald Barré In this post, I describe how to generate a PDF document using an html template and Playwright.

You cannot access local files if you use a data URL. A solution is to write the html page to the disk and open it in playwright (I've added a note to the post). Another solution would be to intercept network request and provide a response (page.RouteAsync)
www.meziantou.net/generate-pdf...

15.02.2025 19:25 👍 0 🔁 0 💬 0 📌 0