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() 
    {
    }
}

Community Additions

ADD
Show: