C# Error CS7000 – Unexpected use of an aliased name

C# Error

CS7000 – Unexpected use of an aliased name

Reason for the Error & Solution

Unexpected use of an aliased name

Examples

The following sample generates CS7000 because the alias qualifier (::) is not supported in a namespace declaration:

using N = ClassLibrary1;

namespace N::A
{
    public class Goo
    {
    }
}

To correct this error

Either remove the unsupported use of the alias in the namespace declaration:

namespace A
{
    void Goo()
    {
    }
}

Or, replace the alias with the fully qualified name:

namespace ClassLibrary1.A
{
    void Goo()
    {
    }
}

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

C# Compiler Error CS0442 – ‘Property’: abstract properties cannot have private accessors Reason for the Error You’ll get this error...
This is a really simple one . Below is a simple example of an enum called “Designation” defined with the...
This blog post explain the usage of the Checked Block in .NET and how you can use them in Visual...