StackTrace Constructor (Thread^, Boolean)
Initializes a new instance of the StackTrace class for a specific thread, optionally capturing source information.
Do not use this constructor overload.
Assembly: mscorlib (in mscorlib.dll)
public: [ObsoleteAttribute("This constructor has been deprecated. Please use a constructor that does not require a Thread parameter. http://go.microsoft.com/fwlink/?linkid=14202")] StackTrace( Thread^ targetThread, bool needFileInfo )
Parameters
- targetThread
-
Type:
System.Threading::Thread^
The thread whose stack trace is requested.
- needFileInfo
-
Type:
System::Boolean
true to capture the file name, line number, and column number; otherwise, false.
| Exception | Condition |
|---|---|
| ThreadStateException | The thread targetThread is not suspended. |
Important |
|---|
Do not use this constructor. It is obsolete, and there is no recommended alternative. When you suspend a thread, you have no way of knowing what code it is executing, and deadlocks can occur very easily. For example, if you suspend a thread while it holds locks during a security permission evaluation, other threads in the AppDomain might be blocked. If you suspend a thread while it is executing a class constructor, other threads in the AppDomain that attempt to use that class are blocked. |
Available since 1.1
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
