0 out of 1 rated this helpful - Rate this topic

<assert> Element

Specifies whether to display a message box when you call the Debug.Assert method; also specifies the name of the file to write messages to.

<configuration> Element
  <system.diagnostics> Element
    <assert> Element
<assert assertuienabled="true|false" logfilename="file name"/>

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute

Description

assertuienabled

Optional attribute.

Specifies whether to display a message box when the Debug.Assert method evaluates to false.

logfilename

Optional attribute.

Specifies the name of the file to write the message to if Debug.Assert evaluates to false.

assertuienabled Attribute

Value

Description

true

Displays the message box. This is the default.

false

Does not display the message box.

Child Elements

None.

Parent Elements

Element

Description

configuration

The root element in every configuration file used by the common language runtime and .NET Framework applications.

system.diagnostics

Specifies trace listeners that collect, store, and route messages and the level where a trace switch is set.

Both attributes in the <assert> element are optional. You can disable message boxes without specifying a file to write the messages to, or you can specify a file to write messages to while leaving message boxes enabled.

The following example shows how to disable displaying message boxes when you call Debug.Assert and write the messages to c:\log.txt.

<configuration>
   <system.diagnostics>
      <assert assertuienabled="false" logfilename="c:\log.txt"/>
   </system.diagnostics>
</configuration>
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.