NAnt SDK Documentation - v0.92 |

# WarningAsError Class

Controls the behaviour of a compiler with regards to the reporting of warnings.

For a list of all members of this type, see WarningAsError Members.

System.Object
NAnt.Core.Element
NAnt.Core.DataTypeBase
NAnt.DotNet.Types.WarningAsError

[Visual Basic]
<ElementName(Name:="warnaserror")>
Public Class WarningAsError
Inherits DataTypeBase
[C#]
[ElementName(Name="warnaserror")]
public class WarningAsError : DataTypeBase

#### Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

#### Example

Instruct a compiler to report warning 0519 as an error.

    <warnaserror>
        <include number="0519" />
    </warnaserror>

Instruct a compiler not to report warning 0519 as an error, if the `release` property is true.

    <warnaserror>
        <exclude number="0519" if="${release}" />
    </warnaserror>

#### Requirements

Namespace: NAnt.DotNet.Types

Assembly: NAnt.DotNetTasks (in NAnt.DotNetTasks.dll)

#### See Also

WarningAsError Members | NAnt.DotNet.Types Namespace