C# Error CS1679 – Invalid extern alias for ‘/reference’; ‘{0}’ is not a valid identifier

C# Error

CS1679 – Invalid extern alias for ‘/reference’; ‘{0}’ is not a valid identifier

Reason for the Error & Solution

Invalid extern alias for ‘/reference’; ‘identifier’ is not a valid identifier

When using the external assembly alias feature of the /reference option, the text that follows /reference: and that precedes the ‘=’ must be a valid C# identifier or keyword according to the C# Language Specification.

To correct this error, change text before the "=" to a valid C# identifier or keyword.

Example

The following example generates CS1679.

// CS1679.cs  
// compile with: /reference:123$BadIdentifier%=System.dll  
class TestClass {  
    static void Main()  
    {  
    }  
}  

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...