Tags

#csharp
csharp

65stories
1 d agolatest
C# 14
Silent shadowing
DVDEV Community: #csharp Adrián Bailador 1 d ago

C# 14 extension members: the shadowing bug the compiler won't warn you about

C# 14's extension member syntax now covers properties and static members, not just methods, yet a type's own member still silently wins over an identically named extension member. The author reproduces this against the .NET 10 SDK with eight tests: the build reports zero warnings and zero errors while every call site quietly switches to new logic.

AI
AI

LLM tokens measured in C#: why AI can't count the R's in strawberry

The model's failure on the "strawberry" question isn't a counting problem: it never sees letters, only numeric pieces called tokens. Using Microsoft.ML.Tokenizers 2.0.1 and the gpt-5 tokenizer, the author measures this from C# and shows that the word alone is a single token with ID 101830, so the r's inside it stay out of reach. The piece also covers how token cost varies by language, by numbers, and by random text such as GUIDs, plus how to count tokens in .NET.

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.

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.

CBOR · .NET
Reading partial binary data
CCC# Corner Aarav Patel 4 d ago

Reading CBOR Data Incrementally in .NET

C# Corner walks through reading CBOR data with the System.Formats.Cbor package, from a basic CborReader example to buffering partial network reads. It stresses separating incomplete input from malformed data, enforcing size limits and defining message boundaries. Useful for services that receive binary payloads from devices or APIs.

Feedback

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

Type of message