Controls the behavior of a compiler with regards to the reporting of
warnings.
Parameters
Attribute | Type | Description | Required |
---|---|---|---|
id | string |
The ID used to be referenced later.
|
False |
refid | string |
The ID to use as the reference.
|
False |
Nested elements
<exclude>
Specifies a list of warnings that the compiler should NOT treat as
errors. This is only useful if NAnt.DotNet.Tasks.CompilerBase.WarnAsError
is true
. Only supported when targeting .NET 2.0
or higher.
Parameters
Attribute | Type | Description | Required |
---|---|---|---|
number | string |
A warning number, or comma-separated list of warnings, that you want
the compiler to suppress or report.
|
True |
if | bool |
If
true then the element will be processed;
otherwise, skipped. The default is true .
|
False |
unless | bool |
If
true then the element will be skipped;
otherwise, processed. The default is false .
|
False |
<exclude>
<include>
Specifies a list of warnings that the compiler should treat as
errors. This overrides the NAnt.DotNet.Tasks.CompilerBase.WarnAsError
attribute. Only supported when targeting .NET 2.0 or higher.
Parameters
Attribute | Type | Description | Required |
---|---|---|---|
number | string |
A warning number, or comma-separated list of warnings, that you want
the compiler to suppress or report.
|
True |
if | bool |
If
true then the element will be processed;
otherwise, skipped. The default is true .
|
False |
unless | bool |
If
true then the element will be skipped;
otherwise, processed. The default is false .
|
False |
<include>
Examples
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
- Assembly
- NAnt
.DotNet .dll - Namespace
-
NAnt
.DotNet .Types