# benaadams/ben.demystifier

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/benaadams-ben-demystifier).**

2,867 stars · 121 forks · C# · apache-2.0

## Links

- GitHub: https://github.com/benaadams/Ben.Demystifier
- awesome-repositories: https://awesome-repositories.com/repository/benaadams-ben-demystifier.md

## Topics

`aspnet-core` `dotnet` `dotnet-core` `error-handling` `error-messages` `exceptions` `stack-traces`

## Description

Ben.Demystifier is a .NET library that transforms raw stack traces into modern C# 7+ syntax. It reads compiler-generated frames produced by async methods, iterators, lambdas, local functions, and generic types, then rewrites them to match the original source code, making exception call stacks and debug output immediately readable.

The library resolves common compiler artifacts such as `MoveNext` frames back into their original async method or iterator names, shows declaring method names and ordinals for lambdas and local functions instead of generated identifiers, and displays resolved generic type parameters and value tuple syntax inside stack frames. It also includes parameter qualifiers like `ref`, `in`, and `out` along with return types in method signatures, and preserves original line numbers and file paths during transformation.

Under the hood, Ben.Demystifier processes stack traces through a pipeline of regex-based token matching, symbol-table resolution, and syntax rewriting, producing immutable output with preserved line numbers. It handles multiple stack trace entries in a single pass to minimise memory allocations. The library is available as a NuGet package and integrates directly into existing .NET debugging workflows.

## Tags

### Software Engineering & Architecture

- [Stack Trace Demystifiers](https://awesome-repositories.com/f/software-engineering-architecture/stacks/stack-trace-formatters/stack-trace-demystifiers.md) — Reads raw .NET stack traces by translating compiler-generated frames into modern C# syntax. ([source](https://github.com/benaadams/Ben.Demystifier#readme))
- [Error Message Interpretation Tools](https://awesome-repositories.com/f/software-engineering-architecture/error-handling/localized-error-messages/error-message-interpretation-tools.md) — Transforms cryptic exception call stacks into human-readable representations.
- [Stack Frame Type Resolvers](https://awesome-repositories.com/f/software-engineering-architecture/generic-type-definitions/generic-type-resolution/stack-frame-type-resolvers.md) — Shows resolved generic parameters and value tuple syntax inside stack frames.
- [Stack Trace Formatters](https://awesome-repositories.com/f/software-engineering-architecture/stacks/stack-trace-formatters.md) — Transforms raw stack traces into modern C# 7+ syntax for clearer debugging.
- [.NET Stack Trace Demystifiers](https://awesome-repositories.com/f/software-engineering-architecture/stacks/stack-trace-formatters/net-stack-trace-demystifiers.md) — Transforms raw .NET stack traces into modern C# 7+ syntax by resolving compiler-generated frames.
- [Stack Trace Generation](https://awesome-repositories.com/f/software-engineering-architecture/stacks/stack-trace-formatters/stack-trace-generation.md) — Produces a human-readable string from a demystified exception or current call stack. ([source](https://github.com/benaadams/Ben.Demystifier#readme))
- [Stack Trace Readability Enhancers](https://awesome-repositories.com/f/software-engineering-architecture/stacks/stack-trace-formatters/stack-trace-readability-enhancers.md) — Converts raw .NET stack traces into modern C# syntax for easier debugging.
- [Stack Trace Syntax Rewriters](https://awesome-repositories.com/f/software-engineering-architecture/stacks/stack-trace-formatters/stack-trace-syntax-rewriters.md) — Applies rule-based substitution to convert old C# stack frame tokens into modern equivalents.
- [Parameter Qualifier Displays](https://awesome-repositories.com/f/software-engineering-architecture/typescript-type-definitions/return-type-annotations/parameter-qualifier-displays.md) — Includes parameter qualifiers like ref, in, and out along with return types in stack traces. ([source](https://github.com/benaadams/Ben.Demystifier#readme))

### Part of an Awesome List

- [Async Frame Resolvers](https://awesome-repositories.com/f/awesome-lists/devtools/async-and-event-handling/async-frame-resolvers.md) — Replaces compiler-generated MoveNext frames with original async method names. ([source](https://github.com/benaadams/Ben.Demystifier#readme))
- [Exception Handling](https://awesome-repositories.com/f/awesome-lists/devtools/exception-handling.md) — High-performance stack trace analysis and formatting.

### Development Tools & Productivity

- [Stack Trace Debugging Workflows](https://awesome-repositories.com/f/development-tools-productivity/c-family-development-workflows/stack-trace-debugging-workflows.md) — Translates legacy stack trace formats into current language constructs for debugging.
- [Async Stack Frame Resolvers](https://awesome-repositories.com/f/development-tools-productivity/stack-frame-navigators/async-stack-frame-resolvers.md) — Replaces compiler-generated async frames with original method names for readable stack traces.

### Networking & Communication

- [Async Iterator Frame Resolvers](https://awesome-repositories.com/f/networking-communication/websocket-message-interception/async-iteration-patterns/async-iterator-frame-resolvers.md) — Replaces compiler-generated MoveNext frames with original async method or iterator names.

### Programming Languages & Runtimes

- [Lambda Frame Resolvers](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/type-system-tools/type-definitions/variable-type-declarations/polymorphic-logic/generic-lambda-expressions/lambda-capture-and-invocation-patterns/lambda-frame-resolvers.md) — Shows declaring method and ordinal for lambdas instead of compiler-generated identifiers. ([source](https://github.com/benaadams/Ben.Demystifier#readme))
- [Lambda Name Resolvers](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/type-system-tools/type-definitions/variable-type-declarations/polymorphic-logic/generic-lambda-expressions/lambda-capture-and-invocation-patterns/lambda-name-resolvers.md) — Shows declaring method names and ordinals for lambdas instead of compiler-generated identifiers.
- [C#](https://awesome-repositories.com/f/programming-languages-runtimes/programming-language-varieties/programming-languages/systems-languages/c/debugging-tools/c.md) — Rewrites compiler-generated method names into readable C# syntax for faster debugging.
