Wednesday, March 4, 2026
String Performance: The Fastest Way to Get a String’s Length
Getting a string length sounds trivial, but this post digs into what the JIT actually does, benchmarking string.Length, AsSpan and other patterns alongside the guidance behind CA1820 and CA1829. Expect practical takeaways on when Span helps, which checks are fastest in hot paths, and how to silence analyzers without sacrificing readability.
Extract Pages from Word Documents Using C#
Alice Yang walks through practical patterns for extracting pages from Word documents in C# using Spire.Doc, from grabbing a single page or range to splitting a file into one document per page. The examples and gotchas around zero-based indexing, page vs section, and safe cloning help you automate approvals and conversions without layout surprises.
Generating SBOM for NuGet packages
Gérald Barré shows how to have your NuGet packages include a Software Bill of Materials by wiring up Microsoft.Sbom.Targets and letting dotnet pack embed an SPDX manifest for you. This post frames SBOMs as practical supply chain hygiene that helps with license visibility and audits while keeping your release flow simple.
Deep C# - Multicast Delegates and Events
Mike James digs into multicast delegates and how they power C# events, untangling Delegate vs MulticastDelegate and showing how invocation lists actually behave in real code. Expect practical takeaways like why the last handler returns the value, how += and -= build or trim pipelines, and the gotcha that an exception stops the chain, all backed by clear examples and lambdas.
Building an authenticated MCP server with Microsoft Entra and .NET
Matteo Pagani shows how to build a secure MCP server in ASP.NET Core that uses Microsoft Entra for identity, fronted by Azure API Management so agents like GitHub Copilot can call your tools safely over Streamable HTTP. In this post, you wire up C# tools with the MCP .NET SDK, generate OpenAPI, publish to App Service, add OAuth code flow metadata in APIM, and lock down the backend, a practical pattern you can reuse for production agent integrations.
Using ClientConnectionId to Correlate .NET Connection Attempts in Azure SQL
Kalyan Singh Bondili shows a pragmatic way to capture and log ClientConnectionId from SqlConnection in .NET to correlate client connection attempts with Azure SQL diagnostics. This post includes a small console app that emits tidy JDBC-style lines with timestamps and IDs so you can pinpoint intermittent connectivity issues faster.
Don't miss the next tip 💧
Get a .NET tip and curated links delivered to your inbox every week.
Set the AMR Claim When Using Passkeys Authentication in ASP.NET Core
Damien Bowden shows how to set the amr claim correctly for passkeys with ASP.NET Core Identity in .NET 10 using the OpenID Connect EAP ACR Values so passkey sign ins return pop as expected. This post shares a clean workaround for the current framework behavior and demonstrates requesting phishing resistant authentication with acr_values so LoA and downstream authorization stay accurate.
Visual Studio February Update
Mark Downie walks through the Visual Studio 2026 February update that leans into practical AI and diagnostics to keep .NET devs in the flow. This post highlights Copilot powered unit test generation, call stack explanations, and a profiler that runs with your tests, plus a WinForms expert agent, richer IEnumerable DataTips, and faster Razor hot reload that smooths out day to day work.
Generic Math in .NET: Design, Constraints, and Practical Use
Viktor Ponamarev walks through how .NET generic math and the INumber
Stop Using ToLower() for Comparisons! The Fast, Correct Way in C#
Lowercasing strings to compare them costs allocations and can break under different cultures (hello, Turkish I). In this video, Michael shows why .ToLower()/.ToUpper() are the wrong tools for comparisons and how StringComparison and StringComparer give you fast, correct behavior. We’ll cover Contains/StartsWith/EndsWith overloads, collection comparers, EF Core caveats, and SQL Server collations. Plus, a tiny benchmark to visualize the allocation difference.
Async Await Just Got A Massive Improvement in .NET
.NET 11 releases big updates to async/await and Nick covers it all in this YouTube video, including performance boosts.
.NET MAUI: C# Expressions in XAML: throw out your converters
Steven Thewissen shows how upcoming C# expressions in .NET MAUI XAML let you bind with {Name}, use real string interpolation, do inline math, and flip booleans without the usual converter circus, trimming boilerplate and multi-bindings. In this post he notes the feature rides on XAML source generation, is available today behind EnablePreviewFeatures in .NET 10, and even supports inline lambda handlers for quick interactions.