Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Warning (level 2) CS0440
Collapse the table of content
Expand the table of content

Compiler Warning (level 2) CS0440

Defining an alias named 'global' is ill-advised since 'global::' always references the global namespace and not an alias

This warning is issued when you define an alias named global.

The following example generates CS0440:

// CS0440.cs
// Compile with: /W:1

using global = MyClass;   // CS0440
class MyClass
{
    static void Main()
    {
        // Note how global refers to the global namespace
        // even though it is redefined above.
        global::System.Console.WriteLine();
    }
}

Community Additions

ADD
Show:
© 2015 Microsoft