A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0169 below:

Compiler Warning (level 3) CS0169 - C#

Compiler Warning (level 3) CS0169

In this article

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.

Additional resources

In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4