0

I need to create a stacktrace in C# on Windows 10 store app (universal). The old classes for generating stacktraces no longer exist and the old trick of throwing an exception, catching, and inspecting the stack trace is also not working (showing only the top-method, which is the one generating the stack).

Any other ideas?

Edit: I need the stacktrace when an assertion is fired while the app is not attached to the debugger - I want to provide testers with the information on where the assertion occurred.

Shahar Prish
  • 4,838
  • 3
  • 26
  • 47
  • 1
    http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem – Hans Passant Mar 31 '16 at 15:25
  • http://stackoverflow.com/questions/31859169/how-to-get-stacktrace-without-exception-in-windows-universal-10-app try some of the suggested links posted in the answers here – MethodMan Mar 31 '16 at 15:25
  • @HansPassant: Added more information on why I need it. Hope that will help you understand this more clearly. – Shahar Prish Mar 31 '16 at 15:35
  • @MethodMan: Sadly none of the answers there apply --> they are talking about environments other than UWP. The links pretty much explain (as far as I can tell) that the only option is ETW (without explaining how it can be used for stacktrace generation, which I could not find) – Shahar Prish Mar 31 '16 at 15:36

1 Answers1

1

According to the documentation Environment.StackTrace is supported in Windows 10 UWP Apps. It wasn't in WinRT. As long as it's merely informational as to where an issue occured you should not run into issues. For more in depth analysis (e.g. performance, etc.) it's discouraged to use the StackTrace.

Oliver Ulm
  • 531
  • 3
  • 8
  • Thanks. I could not find this guy for some reason - figured it out - was looking for it in one of our PCL libraries and not in the UWP project. Thanks. – Shahar Prish Apr 03 '16 at 07:58