Skip to main content

Posts

ASP.NET Core Global Error Handling: Complete Guide

Learn ASP.NET Core global error handling with middleware, IExceptionHandler, Problem Details & logging. Copy runnable C# examples and ship safer APIs today. Unhandled exceptions are inevitable — a database goes down, a third-party API times out, a null sneaks past your validation. What is not inevitable is leaking stack traces to clients, returning inconsistent error payloads, or losing the log entry that would have told you what went wrong. Solid ASP.NET Core exception handling solves all three problems in one place: a single global pipeline that catches every unhandled exception, logs it with full context, and returns a clean, standards-compliant response. In this guide you'll build global error handling for ASP.NET Core step by step — from classic custom middleware, to the modern IExceptionHandler interface in .NET 8+, to RFC 9457 Problem Details and structured logging. Why Global Exception Handling in ASP.NET Core Matters Wrapping every controller action in try/catc...

Terraform Tutorial for .NET Developers: AWS & Azure IaC

Learn Terraform for .NET developers with this hands-on tutorial. Deploy ASP.NET Core apps to AWS and Azure using infrastructure as code. Start today! If you're a .NET developer who has ever clicked through the Azure Portal or AWS Console to create resources by hand, you already know the pain: environments drift apart, nobody remembers who changed what, and reproducing production in a staging environment takes days. This Terraform tutorial is written specifically for .NET developers who want to solve that problem with infrastructure as code (IaC) — defining your cloud infrastructure in version-controlled files, just like your C# code. In this guide, you'll learn what Terraform is, why it beats manual provisioning, and how to deploy a real ASP.NET Core application to both Azure App Service and AWS Elastic Beanstalk using Terraform. We'll also cover best practices, common pitfalls, and how Terraform compares to Bicep and AWS CloudFormation — the questions every .NET ...

Build a Recommendation System in C# with ML.NET

Learn how to build a recommendation system in C# using ML.NET collaborative filtering. Step-by-step tutorial with full code — start building today. Every time Netflix suggests your next binge or Amazon shows you "customers also bought," you're seeing a recommendation system at work. These systems drive an enormous share of engagement and revenue for the world's biggest platforms — and thanks to ML.NET, you can build a production-ready recommendation system in C# without leaving the .NET ecosystem or writing a single line of Python. In this tutorial, you'll build a movie recommendation engine using collaborative filtering with ML.NET's matrix factorization trainer. We'll cover the theory (just enough to make smart decisions), the full working code, how to evaluate your model, and the pitfalls that trip up most developers on their first attempt. What Is a Recommendation System and How Does Collaborative Filtering Work? A recommendation system pre...

C# 13 New Features: Complete Guide for Developers (2026)

Learn all C# 13 new features with runnable code examples — params collections, the Lock type, partial properties and more. Master C# 13 today. C# 13 shipped alongside .NET 9, and by 2026 it has become the version most production teams are writing every day. If you're searching for C# 13 new features , this guide walks through every major addition — params collections, the new System.Threading.Lock type, partial properties, implicit index access, and more — with runnable code examples and, just as importantly, an explanation of why each feature exists and when you should reach for it. Whether you're a beginner wondering how to use the new syntax, an intermediate developer looking for best practices, or a senior engineer evaluating advanced ref struct capabilities, there's something here for you. Let's dig in. What's New in C# 13? A Quick Overview Here's the full list of C# 13 new features at a glance: params collections — params now works wit...

Blazor WebAssembly Tutorial 2026: Build Web Apps in C#

Learn Blazor WebAssembly in 2026 with this step-by-step C# tutorial. Build interactive web apps without JavaScript, with code examples and best practices. If you're a C# developer who has ever groaned at the thought of context-switching into JavaScript, Blazor WebAssembly is the technology you've been waiting for. In 2026, Blazor WebAssembly (often shortened to "Blazor WASM") is a mature, production-ready framework that lets you build fully interactive single-page applications that run entirely in the browser—using nothing but C#, Razor, and .NET. In this Blazor WebAssembly tutorial, you'll learn how it works under the hood, build a working app from scratch with .NET 10, and pick up the best practices and pitfalls that separate a smooth project from a frustrating one. What Is Blazor WebAssembly and Why Does It Matter in 2026? Blazor WebAssembly is a client-side hosting model for ASP.NET Core Blazor. Instead of running your C# on a server and pushing UI dif...

NLP with C# and ML.NET: Complete Guide with Examples

Learn natural language processing in C# with ML.NET: text classification, sentiment analysis, tokenization and TF-IDF with runnable code. Start building today. Natural language processing (NLP) in C# used to mean calling a Python service or a cloud API. That is no longer the case. With ML.NET , Microsoft's open-source machine learning framework for .NET, you can train and run natural language processing in C# entirely inside your own application—no Python, no external runtime, and no per-request fees. This complete guide walks through the core NLP concepts, builds a working sentiment analysis model, shows multi-class text classification, and covers the best practices and pitfalls you will hit in production. What Is Natural Language Processing in C# and Why ML.NET? NLP is the branch of machine learning that teaches software to understand human text: classifying reviews as positive or negative, routing support tickets, detecting spam, extracting topics, and more. Under the ho...

12-Factor App with ASP.NET Core: Cloud-Native .NET Guide

Learn how to build cloud-native .NET apps using 12-factor app principles with ASP.NET Core. Practical C# examples, best practices, and pitfalls. Start now. The 12 factor app methodology is the closest thing the industry has to a shared definition of "cloud-native." Originally published by Heroku engineers, its twelve principles describe how to build applications that deploy cleanly to Kubernetes, Azure App Service, AWS ECS, or any modern platform, scale horizontally without drama, and survive being killed and restarted at 3 a.m. In this guide you'll learn how to apply each of the 12 factor app principles to ASP.NET Core , with runnable C# examples that map directly onto .NET 8/9 features. If you're building cloud-native .NET apps, ASP.NET Core microservices, or moving a legacy app into a .NET Docker container, this is the checklist to build against. What Is the 12-Factor App and Why Does It Matter for .NET? The twelve factors are: Codebase, Dependencies, Confi...