为什么只有一个编译器警告被抑制?

问题描述 投票:0回答:1

这就是我的抑制警告设置在Project Properties -> Build中的样子:

enter image description here

然而,编译器似乎忽略的唯一警告是第一个,CS0168。我仍然有很多CS0414警告:

enter image description here

为什么编译器不忽略CS0414

c# visual-studio visual-studio-2015 compiler-warnings suppress-warnings
1个回答
1
投票

不要包含警告代码的前缀;只包括数字部分。

enter image description here

nowarn compiler option documentation

也就是说,无可否认,它在VS Enterprise 2017中有或没有前缀。

另一个想法是确保在发出这些警告的项目中禁止代码。

© www.soinside.com 2019 - 2024. All rights reserved.