This documentation is archived and is not being maintained.

Compiler Warning (level 3) CS0219

Visual Studio 2008

The variable 'variable' is assigned but its value is never used

The compiler issues a level-three warning, when you declare and assign a variable, but do not use it.

The following sample generates CS0219:

// CS0219.cs
// compile with: /W:3
public class MyClass
   public static void Main()
      int a = 0;   // CS0219