explaingit

davidfowl/aspnetcorediagnosticscenarios

8,508C#Audience · developerComplexity · 2/5Setup · easy

TLDR

A reference collection of real broken code patterns found in ASP.NET Core web applications, with explanations of why each pattern fails and how to fix it. Focuses especially on async programming mistakes that only show up under load.

Mindmap

mindmap
  root((ASP.NET Diagnostics))
    Content
      Broken patterns
      Async pitfalls
      Fix examples
    Topics
      Async programming
      Web API design
      Performance bugs
    Source
      Real incidents
      GitHub issues
      Stack Overflow
    Audience
      C# developers
      API builders
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Review your ASP.NET Core codebase against documented anti-patterns to find async bugs that only appear under heavy traffic.

USE CASE 2

Use as a code review checklist when auditing a C# web service for correctness and performance.

USE CASE 3

Learn why specific patterns cause deadlocks or slowdowns in production by reading real incident-sourced examples.

Tech stack

C#ASP.NET Core.NET

Getting it running

Difficulty · easy Time to first run · 5min
License not specified in the explanation.

In plain English

This repository is a reference collection of broken and problematic code patterns found in real ASP.NET Core applications. ASP.NET Core is a framework developers use to build web servers and web APIs with the C# programming language. The goal here is not to build a working product, but to document mistakes that show up repeatedly in production codebases and explain how to fix them. The content comes from real incidents: issues customers encountered, problems surfaced on GitHub discussions, and questions from Stack Overflow. Rather than being a generic tutorial, it reflects the kinds of bugs and performance problems that actual teams ran into while building services that need to handle many users at once. The repository contains two main guides. One covers general ASP.NET Core patterns and what goes wrong with them. The other focuses on asynchronous programming, which is a common source of subtle bugs where code appears to work correctly in simple tests but fails or slows down under load. Both guides are written to help developers understand not just what to avoid, but why the problematic patterns cause trouble. The README is short and the real content lives in the linked guide files rather than the main page. If you are a developer working with ASP.NET Core, this is a practical reference rather than a beginner introduction.

Copy-paste prompts

Prompt 1
My ASP.NET Core API slows down under load but works fine in tests. Walk me through the async anti-patterns from aspnetcorediagnosticscenarios that could cause this.
Prompt 2
My ASP.NET Core service occasionally deadlocks in production. How do I identify and fix async-over-sync patterns like using .Result or .Wait()?
Prompt 3
Generate a code review checklist for ASP.NET Core web APIs based on the most common mistakes in David Fowler's diagnostic scenarios repo.
Prompt 4
What is wrong with calling .Result on a Task inside an ASP.NET Core controller action, and what is the correct replacement?
Open on GitHub → Explain another repo

← davidfowl on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.