c# - How to Convert StackFrame Collection to String? -
i have ienumerable<system.diagnostics.stackframe> frames
store custom stackframe. want convert string type stacktrace.tostring()
format. example:
@ teststacktrace.form1.button2_click(object sender, eventargs e) in d:\programming\temp\teststacktrace\teststacktrace\form1.cs:line 66 @ system.windows.forms.control.onclick(eventargs e) @ system.windows.forms.button.onclick(eventargs e) @ system.windows.forms.button.onmouseup(mouseeventargs mevent)
use stateprinter framework. can turn object graphs strings , automate assert part of testing. see https://github.com/kbilsted/stateprinter/blob/master/doc/automatingunittesting.md
for making string
string s = new stateprinter().printobject(stackframe)
Comments
Post a Comment