C# reusable function to dump current value of local variables

前端 未结 3 1094
攒了一身酷
攒了一身酷 2020-12-15 01:49

I would like to write a reusable function I can call within any method to log a snapshot of all the local variables. For example:

    void somemethod()
             


        
3条回答
  •  长情又很酷
    2020-12-15 02:23

    Consider to write minidumps using a custom PostSharp aspect (with IL transformation).

    A shared debuging engine library, written in C#. is available on NuGet as Microsoft.Samples.Debugging.MdbgEngine.

    The code of PostSharp aspect is available on GitHub as part of the PADRE ( Pluggable Automatic Debugging and Reporting Engine)repository

提交回复
热议问题