Ben.Demystifier Documentation

repository·main·Indexed 25 days ago

https://github.com/benaadams/ben.demystifier

A high-performance .NET library that transforms compiler-generated stack traces into readable C# source-like formats. It resolves async/await, iterators, lambdas, and local functions via the .Demystify() extension method and EnhancedStackTrace.Current().

Tokens
234
Snippets
1
Records
3
Agent score
34%

What's inside Ben.Demystifier

  1. Run benchmarks for Ben.Demystifier

    main

    To execute the benchmarks from the repository root, use the following dotnet command. Note that while the command kicks off via netcoreapp2.0, benchmarks will run for all configured platforms (e.g., net462).

    dotnet run -p .\test\Ben.Demystifier.Benchmarks\ -c Release -f netcoreapp2.0 All
  2. Get the current enhanced stack trace with EnhancedStackTrace.Current()

    main
    Instead of using Environment.StackTrace, use EnhancedStackTrace.Current() to resolve the current stack back to the C# source format. This returns an inspectable list of stack frames that are easier to parse and match to your source code.
  3. Demystify an exception with .Demystify()

    main
    To transform a standard .NET exception stack trace into a readable format that matches your C# source code, call the .Demystify() extension method on your exception instance. This resolves compiler-transformed names for features like async/await, iterators, lambdas, and local functions.