如何获得堆栈跟踪无一例外在Windows 10的通用应用程序 [英] How to get StackTrace without Exception in Windows Universal 10 App

查看:210
本文介绍了如何获得堆栈跟踪无一例外在Windows 10的通用应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是可能的使用方法:

I know it was possible to use:

System.Diagnostics.StackTrace t = new System.Diagnostics.StackTrace();



但似乎不再起作用,因为它需要一个异常对象。

but that seems to not work anymore, as it needs an Exception-Object.

推荐答案

尝试Environment.StackTrace。只记得要小心什么以后你的逻辑是堆在不可预知的方式改变。这里一些讨论: https://github.com/dotnet/corefx/issues/1420

Try Environment.StackTrace. Just remember to be careful with what your logic afterwards is as stacks can change in unpredictable ways. Some discussion here: https://github.com/dotnet/corefx/issues/1420

这篇关于如何获得堆栈跟踪无一例外在Windows 10的通用应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆