Compiler Error CS1025
Single-line comment or end-of-line expected
A line with a preprocessor directive cannot have a multiline comment.
The following sample generates CS1025:
C#
#if true /* hello
*/ // CS1025
#endif // this is a good comment
CS1025 could also occur if you attempt some invalid preprocessor directive, as follows:
C#
// CS1025.cs
#define a
class Sample
{
static void Main()
{
#if a 1 // CS1025, invalid syntax
System.Console.WriteLine("Hello, World!");
#endif
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: