This documentation is archived and is not being maintained.

Compiler Warning (level 3) CS0414 

Error Message

The private field 'field' is assigned but its value is never used

This warning occurs if you have a private field in a type that is assigned to, but that value is never subsequently read. The unnecessary assignment could impact performance.

The following sample generates CS0414:

// CS0414
// compile with: /W3
class C
   private int i = 1;  // CS0414

   public static void Main()
   { }