Compiler Error CS0234
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Error CS0234 

Error Message

The type or namespace name 'name' does not exist in the namespace 'namespace' (are you missing an assembly reference?)

A type was expected. Possible reasons include:

  • An assembly that contains the definition of a type was not referenced in the compilation; use /reference (Import Metadata) to specify the assembly.

  • You passed a variable name to the typeof operator.

See Add Reference Dialog Box for information on how to add a reference in the development environment.

The following sample generates CS0234:

// CS0234.cs
public class C
   public static void Main()
      System.DateTime x = new System.DateTim();   // CS0234
      // try the following line instead
      // System.DateTime x = new System.DateTime();
© 2016 Microsoft