HomeCSharpC# Error CS7000 – Unexpected use of an aliased name

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

This C# program calculates and displays an upper triangular matrix based on user input. Problem Statement: The program takes the...
This C# program serves as a demonstration of bitwise operators, which are fundamental operators used for manipulating individual bits in...
This C# program is designed to interchange or swap the columns of a matrix. A matrix is a two-dimensional array...