Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This topic has not yet been rated - Rate this topic

Exception.StackTrace Property

Gets a string representation of the frames on the call stack at the time the current exception was thrown.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)
public virtual string StackTrace { get; }

Property Value

Type: System.String
A string that describes the contents of the call stack, with the most recent method call appearing first.

The execution stack keeps track of all the methods that are in execution at a given instant. A trace of the method calls is called a stack trace. The stack trace listing provides a means to follow the call sequence to the line number in the method where the exception occurs.

StackTrace may not report as many method calls as expected, due to code transformations, such as inlining, that occur during optimization.

Notes to Inheritors

The StackTrace property is overridden in classes that require control over the stack trace content or format.

By default, the stack trace is captured immediately before an exception object is thrown.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.