Visual Studio警告级别的含义? [英] Visual Studio warning level meanings?

查看:240
本文介绍了Visual Studio警告级别的含义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Web应用程序项目的构建"选项卡上,我有一个名为警告级别"的设置.我可以在0到4之间设置一个值.这些值是什么意思?值0会更严格并产生更多警告吗,反之亦然?我还没有找到任何文档,但是也许我在找错地方了.

On the build tab in a Web Application project I have a setting called "Warning Level". I can set a value from 0 to 4. What do these values mean? Will a value of 0 be more strict and generate more warnings, or vice versa? I haven't been able to find any documentation on it yet, but perhaps I'm looking in the wrong place.

推荐答案

This link shows you the definitions of the warning levels (I'm assuming you are using C# code in your web project). Level 4 is the most strict.

  • 0:关闭所有警告消息的发出.
  • 1:显示严重警告消息.
  • 2:显示1级警告以及某些不太严重的警告,例如有关隐藏班级成员的警告.
  • 3:显示2级警告以及某些不太严重的警告,例如关于始终评估为 true false 的表达式的警告.
  • 4:显示所有3级警告以及信息警告.这是命令行上的默认警告级别.
  • 0: Turns off emission of all warning messages.
  • 1: Displays severe warning messages.
  • 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: Displays all level 3 warnings plus informational warnings. This is the default warning level at the command line.

这篇关于Visual Studio警告级别的含义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆