C#
news

17stories

Stories

C# 14
Events and subscriptions

Events and Delegates in C#: Contracts, Subscriptions and Notification

This article explains the difference between delegates and events in C#, the subscription boundary an event creates, and how multicast invocation behaves when a handler throws. It also covers what notification does not guarantee: completion of every subscriber, async handling and subscription lifetime. Read it to design event-based notifications with clearer contracts.

Avalonia 12
Markdown notes, no WebView
HBHabr C# (ru) OlegChe77 3 d ago

Markdown notes app on Avalonia without WebView: lessons from a C# project

A Russian developer built Leaflet, a Windows Markdown notes app in C# on Avalonia 12 with AvaloniaEdit, without WebView or Electron. Notes stay as plain .md files with wiki-style links and backlinks, and the app starts in under a second. The write-up covers live preview, browser-free PDF export and the rough edges of window decorations, caret placement and file-conflict safety.

C# 15
Add your own indexer

C# 15 Extension Indexers: Add [] Syntax to Types You Don't Own

C# 15 lets you declare indexers inside extension blocks, so types you don't own can support square-bracket access. Adding Count and Slice also unlocks index-from-end, ranges, and list patterns. The feature was tested on the .NET 11 RC 1 SDK, and the article lists its gotchas: real indexers win silently, arrays and strings are excluded, and expression trees reject it.

Steam achievements
Batch unlocks, owned DLC
DVDEV Community: #csharp zevnda 3 d ago

Steam achievement sets: batched unlocks fail on unowned DLC

Valve's Achievement Sets beta lets Steam games group achievements by base game, DLC and other sets. Steam refuses unlocks for DLC the account doesn't own or for archived sets, and one rejected item can fail an entire batch write. A C# developer maintaining an achievement manager explains the schema changes, the parsing code and the ownership-check fix.

Metalama 2027.0
Redirect calls at build time
PMMetalama / PostSharp Blog Gaël Fraiteur 4 d ago

Metalama 2027.0 adds interceptors to redirect method calls at build time

Metalama 2027.0 introduces call-site interceptors that rewrite selected method calls at build time, so a method from a NuGet package or the .NET libraries can be wrapped without touching its source. The post walks through a retry example built from a T# template, a hand-written audit redirect, and the scoping rules. The feature is in preview from 2027.0.4-preview.

Game Boy in C#
Rebuild hardware in C#
DPdotnetpro (de) Stefan Fiedler 5 d ago

Game Boy emulation in C#, part 1: CPU, memory and registers

A new dotnetpro series walks through building a Game Boy emulator in C#. Part one covers the 16-bit address bus, the 64 KB memory map, CPU registers modeled as C# fields and properties, and the flag register. It also shows how opcodes are dispatched in a switch loop and how cycle counting keeps components in sync.

.NET 10
Custom sort vs LINQ
CCC# Corner Željko Perić Oct 25

Custom Array Sorting vs LINQ: BenchmarkDotNet Results for 2D and Jagged Arrays

Željko Perić benchmarks his custom multi-column sort extensions for 2D and jagged arrays against the standard LINQ OrderBy/ThenBy pipeline using BenchmarkDotNet. The results show how memory layout and sorting algorithm change speed and allocations on datasets up to one million rows. It is a practical reference for developers who care about GC pressure in data-heavy code.

.NET 11
Full outer joins in LINQ

LINQ gets FullJoin in .NET 11 for full outer joins

The new FullJoin method in .NET 11 returns matched pairs plus unmatched rows from both sides as (Outer, Inner) tuples. Join, LeftJoin, RightJoin and GroupJoin also gain overloads without a result selector. The feature is in .NET 11 RC2, so details may still change before the final release.

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message