代码之家  ›  专栏  ›  技术社区  ›  ProfK

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

  •  0
  • ProfK  · 技术社区  · 8 年前

    这就是“抑制警告”设置在中的外观 Project Properties -> Build :

    enter image description here

    然而编译器似乎忽略的唯一警告是第一条, CS0168 CS0414 警告:

    enter image description here

    为什么编译器没有忽略 CS0414 ?

    1 回复  |  直到 8 年前
        1
  •  1
  •   Igby Largeman    8 年前

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

    enter image description here

    nowarn compiler option documentation

    也就是说,在VS Enterprise 2017中,无论是否使用前缀,它都可以工作。