Compiler Error CS0426
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:
C#
// 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
}
}
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.
.NET feedback
.NET is an open source project. Select a link to provide feedback: