Tags

#dotnet
dotnet

7stories
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.

EF Core 11
One config file for commands
DVDEV Community: #csharp Mikhail Nefedov Oct 24

EF Core 11 adds .config/dotnet-ef.json for dotnet ef defaults

EF Core 11 lets the dotnet ef command-line tool read default options from a .config/dotnet-ef.json file. When your DbContext lives outside the startup project, you no longer need to repeat --project and --startup-project on every migration or database command. The tool finds the nearest config by walking up the folder tree, and explicit command-line flags still take precedence.

Feedback

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

Type of message