Compiler Warning (level 3) CS0169
The private field 'class member' is never used
A private variable was declared but never referenced. A common way to generate this warning is when you declare a private member of a class and do not use it.
The following sample generates CS0169:
// compile with: /W:3
using System;
public class ClassX
{
int i; // CS0169, i is not used anywhere
// Remove the above variable declaration or uncomment TestMethod to clear warning CS0169
/*
public void TestMethod()
{
i = 5;
System.Console.WriteLine(i);
}
*/
public static void Main()
{
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.