Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Visual C#
C# Reference
 Compiler Error CS0426
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual C# Reference: Errors and Warnings
Compiler Error CS0426

Updated: October 2008

The type name 'identifier' does not exist in the type 'type'

This error occurs when you reference a type nested within another type, but no such nested type exists. This can occur if you mistype the name of the nested type. Check the spelling of the names used, and verify that the enclosing type has the expected member.

The following sample generates CS0426 because class C has no nested type A:

// CS0426.cs

class C
{
    // No nested types are declared.   
}

class D
{
   public static void Main()
   {
       C c = new C();
       // Attempt to reference a nested type A:
       C.A a; // CS0426 because no such type C.A
   }
}

Date

History

Reason

October 2008

Changed explanatory text and example.

Customer feedback.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker