Edit

Share via


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()  
   {  
   }  
}