Compiler Error CS0439
An extern alias declaration must precede all other elements defined in the namespace
This error occurs when an extern
declaration comes after something else, such as a using
declaration, in the same namespace. The extern
declarations must come before all other namespace elements.
The following example generates CS0439:
// CS0439.cs
using System;
extern alias MyType; // CS0439
// To resolve the error, make the extern alias the first line in the file.
public class Test
{
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.
.NET feedback
.NET is an open source project. Select a link to provide feedback: