Shahar Prish
Shahar Prish

Reputation: 4849

How do I generate a stacktrace (text only) in debug?

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.

Upvotes: 0

Views: 126

Answers (1)

Oliver Ulm
Oliver Ulm

Reputation: 531

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.

Upvotes: 1

Related Questions