MSDN:Warning Level of Visual Studio

/warn (C# Compiler Options)
Visual Studio 2010

The /warn option specifies the warning level for the compiler to display.

otherCopy
/warn:option
Arguments
--------------------------------------------------------------------------------

option
The warning level you want displayed for the compilation: Lower numbers show only high severity warnings; higher numbers show more warnings. Valid values are 0-4:

Warning level
Meaning

0
Turns off emission of all warning messages.
[
TAG001:
emission [i'miʃən]
n. 发射,放射,发出,放出,排出
{hyp--Custom basic useful usages:
1.nocturnal emission
遗精,梦遗

2.infrared emission
红外发射

3.photoelectric emission
光电发射,光电子发射

4.thermal emission
热发射

5.secondary emission
次级发射,二次发射,二次排放


}
]

1
Displays severe warning messages.
[
TAG002:
severe [si'viə]
a. 严格的,凶猛的,严肃的,严重的,严厉的,朴素的
{hyp--Custom Basic Useful Usages:
1.Spring comes after the severe winter.
严冬过后是春天。
2.I have a severe pain in my leg.
我腿部剧烈疼痛。
3.The flood presented the province with severe problems.
洪水使该省面临种种严重问题。
4.A high fever usually indicates severe illness.
高烧通常表明生了重病。
5.To inflict severe pain on;torture.
使痛苦使受剧烈的痛苦;折磨
}
]

2
Displays level 1 warnings plus certain, less-severe warnings, such as warnings about hiding class members.

3
Displays level 2 warnings plus certain, less-severe warnings, such as warnings about expressions that always evaluate to true or false.

4 (the default)
Displays all level 3 warnings plus informational warnings.


Remarks
--------------------------------------------------------------------------------

To get information about an error or warning, you can look up the error code in the Help Index. For other ways to get information about an error or warning, see C# Compiler Errors.

Use /warnaserror to treat all warnings as errors. Use /nowarn to disable certain warnings.

/w is the short form of /warn.

To set this compiler option in the Visual Studio development environment
1.Open the project's Properties page.

2.Click the Build property page.

3.Modify the Warning Level property.

For information on how to set this compiler option programmatically, see WarningLevel.

Example
--------------------------------------------------------------------------------

Compile in.cs and have the compiler only display level 1 warnings:

otherCopy
csc /warn:1 in.cs
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值