#548 – March 16, 2025
Using reference tracking for a .NET garbage collector in C#
Walking the reference graph for .NET garbage collector
11 minutes by Kevin Gosse
This article explains how to implement reference tracking for a .NET garbage collector in C#, focusing on finding references between objects using GCDesc structures. It details how GCDesc encodes reference locations within objects through ranges, explains different encoding patterns for regular objects versus arrays of value types, and provides code examples for traversing reference graphs—a critical step toward marking reachable objects during garbage collection.
The intelligent terminal with AI built for Windows
sponsored by Warp
Never forget a command or struggle with syntax again. Warps Agent Mode allows you to type in natural language to accomplish any task right in the terminal. Store and share resources, from repeatable runbooks to templatized commands with Warp Drive.
New, simpler solution file format
8 minutes by Chet Husk
Microsoft has introduced a new XML-based solution file format called SLNX for .NET and Visual Studio, which is more concise than the traditional SLN format while maintaining all functionality. Starting with .NET SDK 9.0.200, developers can migrate to this format using the "dotnet sln migrate" command, and the CLI supports building and managing projects in SLNX files just like with traditional solution files.
Covariance and contravariance in interfaces
12 minutes by Liam Mooney
Covariance (marked with 'out' keyword) allows for conversions from more specific to more general types, as seen in IEnumerable where values only come out of the interface. Contravariance (marked with 'in' keyword) works in the opposite direction, allowing conversions from more general to more specific types, as demonstrated by IComparer where values only go into the interface.
Enforcing .NET Coding Guidelines with GitHub Copilot Custom Instructions
4 minutes by Oleksii Nikiforov
Using GitHub Copilot with custom instructions can improve the quality of generated code by enforcing coding guidelines. Oleksii will show you how to use GitHub Copilot custom instructions in the context of .NET development. You can use his repository with a set of rules as a starting point.
Resolving Paths To Server Relative Paths in .NET Code
10 minutes by Rick Strahl
In this post Kevin describes how you can build a couple of helpers that are more flexible and also provide some additional functionality of resolving site root and relative paths to full site root paths.
And the most popular article from the last issue was: