This documentation is archived and is not being maintained.

Compiler Error CS0103

The name 'name' does not exist in the class or namespace 'namespace'

An attempt was made to use a name that does not exist in the class or the namespace.

The following sample generates CS0103:

// CS0103.cs
using System;

class MyClass
{
   public static void Main()
   {
      // MyClass test = null;
      try
      {
         MyClass conn = new MyClass();   // delete this line
         // and uncomment the following line and the line above the try
         // conn = new MyClass();
      }
      catch(Exception e)
      {
         if (conn != null)   // CS0103
            Console.WriteLine("{0}", e);
      }
   }
}
Show: