更新:2007 年 11 月
错误消息
私有字段“class member”从未使用过
声明了私有变量,但从未引用过。在声明了类的私有成员却没有使用它时,通常将生成该警告。
下面的示例生成 CS0169:
// compile with: /W:3
using System;
public class ClassX
{
int i; // CS0169, i is not used anywhere
public static void Main()
{
}
}