Debug.Assert Method (Boolean, String)
Checks for a condition and displays a specified message if the condition is false.
Assembly: System (in System.dll)
'Declaration <ConditionalAttribute("DEBUG")> _ Public Shared Sub Assert ( _ condition As Boolean, _ message As String _ )
The overload displays a message that you specify.
The default behavior displays an Assert dialog box when the application runs in user-interface mode, and outputs the message to the debugger when in debug mode.
The Assert method behaves differently in Silverlight-based applications than it does in desktop applications. When an Assert occurs in Windows, a dialog box is displayed with two options, OK and Cancel. Cancel causes the debugger to break at the Assert statement; OK causes it to continue. On the Apple Macintosh OS X, the dialog box only provides the option to continue. In either case, if a debugger is not currently attached, you may attach one before you close the dialog box. On the Apple Macintosh OS X, managed debugging can be done only through remote debugging on a Windows computer by using a Visual Studio plug-in.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.