Best of C#March 2026

  1. 1
    Article
    Avatar of dotnet.NET Blog·11w

    Extend your coding agent with .NET Skills

    Microsoft's .NET team has launched dotnet/skills, a GitHub repository hosting agent skills for .NET developers. Agent skills are lightweight packages bundling intent, task-specific context, and supporting artifacts that coding agents like GitHub Copilot and Claude Code can discover and use to complete tasks more reliably. The repo follows the Agent Skills specification and is organized as a plugin marketplace. Skills can be installed via CLI commands or VS Code Copilot settings. The team validates each skill against a baseline to measure whether it actually improves agent responses, and plans to iterate based on community feedback.

  2. 2
    Article
    Avatar of hnHacker News·9w

    Windows Native App Development Is a Mess

    A developer with a Windows background attempts to build a small native Windows utility app using the latest Microsoft technologies (WinUI 3, Windows App SDK) and documents the painful experience. The post covers the fragmented history of Windows UI frameworks (Win32 → MFC → WinForms → WPF → WinRT → UWP → WinUI 3), the awkward deployment choices (.NET AOT vs framework-dependent), the constant need to fall back to Win32 P/Invoke for basic features, and the poor state of tooling like CsWin32. The author concludes that Microsoft treats native app development as a low priority, and argues that web-based stacks like Electron or Tauri are a more rational choice for most developers.

  3. 3
    Article
    Avatar of devblogsDevBlogs·11w

    Announcing WinUI Gallery 2.8

    WinUI Gallery 2.8 has been released, adding Windows jump list integration that lets users quickly access favorited or recently viewed samples from the taskbar. The release includes new samples for AppWindow TitleBar customization, jump lists, and improved clipboard operations. Additional improvements include 60+ new Segoe Fluent Icons, accessibility enhancements, upgraded .NET 9 and Windows App SDK 1.85 support, and improved launch performance.

  4. 4
    Article
    Avatar of csharpcornerC# Corner·11w

    LINQ in C#

    An introductory guide to LINQ (Language Integrated Query) in C#. Covers what LINQ is, why it was introduced, and where it can be used. Walks through common LINQ methods including Where, Select, OrderBy, First/FirstOrDefault, Count, Sum, Max, and Min. Compares method syntax vs query syntax, demonstrates a real-world example with a class, and explains the important concept of deferred execution. Also highlights common beginner mistakes.

  5. 5
    Article
    Avatar of thedailywtfThe Daily WTF·11w

    Anti-Simplification

    A cautionary tale about over-engineering: a CTO replaced a simple SQL view with a Rube Goldberg machine involving two schedulers, two Azure Data Factory pipelines, multiple Azure Functions, C# DLLs with factory classes, reflection-based joins, and struct-copying functions — all to replicate what a few hundred lines of SQL could have done. The result was 50,000 lines of heavily duplicated C# code where adding a single table takes a month.

  6. 6
    Article
    Avatar of atomicobjectAtomic Spin·9w

    C# Finally Has First-Class CLI Scripts in .NET 10

    .NET 10 introduces file-based apps, enabling C# developers to run standalone .cs files directly with `dotnet run file.cs` — no .csproj required. Scripts can reference NuGet packages and existing project files via directives like `#:package` and `#:project`, giving scripts direct access to application domain logic. This fills a long-standing gap in the C# ecosystem (previously addressed only by F#'s `dotnet fsi` or third-party tools), making it practical to maintain a Scripts/ folder for data seeding, format verification, one-off exports, and other utility tasks without creating throwaway console apps or polluting test suites.

  7. 7
    Article
    Avatar of aspnetASP.NET Blog·11w

    Release v1.0 of the official MCP C# SDK

    The Model Context Protocol (MCP) C# SDK has reached v1.0, implementing the 2025-11-25 MCP Specification. Key additions include: enhanced OAuth authorization server discovery with three PRM exposure methods; icon metadata for tools, resources, and prompts; incremental scope consent following the principle of least privilege; URL mode elicitation for secure out-of-band user interactions; tool calling support within LLM sampling requests using Microsoft.Extensions.AI; OAuth Client ID Metadata Documents (CIMD) as a preferred alternative to Dynamic Client Registration; long-running HTTP request handling via SSE polling with DistributedCacheEventStreamStore; and experimental Tasks support for durable state tracking and deferred result retrieval with lifecycle management.

  8. 8
    Article
    Avatar of wearedotnetWe Are .NET·12w

    .NET 10: System.Text.Json Improvements – Anthony Giretti's .NET blog

    Two notable improvements are coming to System.Text.Json in .NET 10. First, duplicate JSON property rejection: previously, deserializing JSON with duplicate keys silently kept the last value; now you can set AllowDuplicateProperties = false on JsonSerializerOptions to throw a JsonException instead, enabling stricter input validation. Second, direct PipeReader integration: rather than bridging a PipeReader to a Stream or manually looping with Utf8JsonReader, you can now pass a PipeReader directly to JsonSerializer.DeserializeAsync, reducing boilerplate and improving performance in high-throughput pipeline scenarios.

  9. 9
    Article
    Avatar of bartwullemsThe Art of Simplicity·12w

    TryParse error when using Minimal APIs

    A gotcha in ASP.NET Core Minimal APIs causes an InvalidOperationException when a service class injected into an endpoint has a non-static TryParse method. Starting from .NET 6, the framework validates the signature of any TryParse method found on parameter types and throws if it doesn't match the expected static binding convention. The fix is simple: rename the method to something other than TryParse so the model binding conventions don't apply.

  10. 10
    Video
    Avatar of zoranhorvatZoran Horvat·11w

    Immutability Wastes RAM? Not Quite!

    A common belief is that immutable designs waste more memory than mutable ones because every operation creates a new object. This is a misconception. The key insight is 'persistent objects': in well-designed immutable systems, operations reuse large portions of the existing object graph, only creating new objects at the top level while sharing unchanged sub-objects. Mutable designs cannot safely share object references because one owner mutating a shared object would corrupt the state of another. This means immutable designs can actually allocate fewer total objects than equivalent mutable designs, while also reducing bugs. The C# compiler is cited as a real-world example of a fast, low-memory, fully immutable system.

  11. 11
    Article
    Avatar of freecodecampfreeCodeCamp·9w

    How to Work With Dapper in .Net

    A hands-on guide to using Dapper, a micro-ORM for .NET, to build a Web API backed by PostgreSQL. Covers installation, database seeding, the repository pattern, CRUD operations (query, insert, update, delete), SQL injection protection via parameterisation, batch deletes, transactions, and multi-mapping for JOIN queries. Compares Dapper to Entity Framework, highlighting trade-offs between development speed and execution performance.

  12. 12
    Article
    Avatar of clickhouseClickHouse·12w

    ClickHouse.Driver 1.0.0: The Official .NET Client Hits Stable

    ClickHouse.Driver 1.0.0 is the first stable release of the official .NET client for ClickHouse. It introduces a new `ClickHouseClient` API that replaces ADO.NET classes for most use cases, offering thread-safe, singleton-friendly access with methods for DDL, bulk inserts, streaming queries, and raw format I/O. Key additions include automatic SQL parameter type extraction, JWT authentication, POCO serialization for JSON columns, mid-stream exception detection, QBit vector type support, and automatic query ID generation. The release drops .NET Framework/.NET Standard support (targets net6.0–net10.0), changes DateTime behavior for timezone-less columns, deprecates `ClickHouseBulkCopy`, and changes the JSON write mode default from Binary to String. ADO.NET compatibility is retained for ORM use with Dapper and linq2db.

  13. 13
    Article
    Avatar of aspnetASP.NET Blog·10w

    Pin Clustering in .NET MAUI Maps

    NET MAUI 11 Preview 2 introduces pin clustering for the Map control on Android and iOS/Mac Catalyst. A single property `IsClusteringEnabled="True"` activates automatic grouping of nearby pins into cluster markers with count badges. Pins can be assigned a `ClusteringIdentifier` to form independent clusters by category (e.g., coffee shops vs. parks). A `ClusterClicked` event provides access to the pins in a cluster, their geographic center, and the ability to suppress default zoom behavior. On Android, a custom grid-based algorithm handles clustering; on iOS/Mac Catalyst, native MapKit `MKClusterAnnotation` support is used. The feature is available in .NET 11 Preview 2 with sample code in the maui-samples repository.

  14. 14
    Video
    Avatar of zoranhorvatZoran Horvat·10w

    Why C# Refuses to Compare Collections

    C# compares collections by reference rather than by value, and this design decision is intentional. There is no single correct definition of collection equality: two collections could be considered equal if they contain the same elements in the same order (sequence equality), or the same elements regardless of order (content/multiset equality). The post demonstrates implementing custom IEqualityComparer classes — a SequenceComparer using LINQ's SequenceEqual and a ContentComparer that sorts before comparing — to show how developers can define equality themselves. It also highlights performance implications (O(n) for sequence, O(n log n) for content comparison vs. O(1) for reference) and the fundamental problem of defining equality on mutable objects, which can lead to stale or incorrect equality flags after mutation.

  15. 15
    Article
    Avatar of telerikTelerik·11w

    How to Organize Minimal APIs

    Minimal APIs in .NET can lead to bloated Program.cs files as applications grow. This post walks through refactoring a messy Program class by separating concerns into dedicated folders and classes: models, infrastructure, extension methods, and endpoint modules. It also introduces the Carter library, which enables defining HTTP routes in isolated ICarterModule classes, keeping Program.cs clean and decoupled from route definitions.