STrace.Assert Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Checks for a condition. If the condition is false, this method sends messages and displays a message box that shows the call stack.
Overloads
Assert(Boolean) |
Checks for a condition. If the condition is false, displays a message box that shows the call stack. |
Assert(Boolean, String) |
Checks for a condition. If the condition is false, this method sends a specified message and displays a message box that shows the call stack. |
Remarks
Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.
This method works only in debug builds.
Assert(Boolean)
Checks for a condition. If the condition is false, displays a message box that shows the call stack.
public:
static void Assert(bool condition);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert (bool condition);
[<System.Diagnostics.Conditional("DEBUG")>]
static member Assert : bool -> unit
Public Shared Sub Assert (condition As Boolean)
Parameters
- condition
- Boolean
The conditional expression to evaluate. If the condition is true, a failure message is not sent and the message box is not displayed.
- Attributes
Remarks
Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.
This method works only in debug builds.
Applies to
Assert(Boolean, String)
Checks for a condition. If the condition is false, this method sends a specified message and displays a message box that shows the call stack.
public:
static void Assert(bool condition, System::String ^ message);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert (bool condition, string message);
[<System.Diagnostics.Conditional("DEBUG")>]
static member Assert : bool * string -> unit
Public Shared Sub Assert (condition As Boolean, message As String)
Parameters
- condition
- Boolean
The conditional expression to evaluate. If the condition is true, the specified message is not sent and the message box is not displayed.
- message
- String
The message to send.
- Attributes
Remarks
Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.
This method works only in debug builds.