WriteLineIf Method
Collapse the table of content
Expand the table of content

Debug.WriteLineIf Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Writes a specified message followed by a line terminator to the debugger by using OutputDebugString function if a condition is true.

Namespace:  System.Diagnostics
Assembly:  System (in System.dll)

'Declaration
<ConditionalAttribute("DEBUG")> _
Public Shared Sub WriteLineIf ( _
	condition As Boolean, _
	message As String _
)

Parameters

condition
Type: System.Boolean
The conditional expression to evaluate. If the condition is true, the specified message is written to the debugger.
message
Type: System.String
A message to write to the debugger.

By default, the output is written to the debugger.

NoteNote:

The WriteLineIf(Boolean, String) method behaves differently in Windows Phone applications than it does in desktop applications. There is no Listeners collection to specify the destination for debug output. The debugging information is sent to the OutputDebugString function and to the debugger, if one is attached. The Visual Studio debugger displays the information in the Output window. If a debugger is not attached, the output from OutputDebugString can be viewed by using a debug viewer.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft