C# Compiler Error Codes CS1001 to CS1500

In this post, you’ll learn all the C# compiler error and warnings from the code CS1001 to CS1500.

C# Compiler Error Codes CS1001 to CS1500

Error CodeTypeError/Warning Description
CS1001ErrorIdentifier expected
CS1002Error; expected
CS1003ErrorSyntax error, ‘{0}’ expected
CS1004ErrorDuplicate ‘{0}’ modifier
CS1007ErrorProperty accessor already defined
CS1008ErrorType byte, sbyte, short, ushort, int, uint, long, or ulong expected
CS1009ErrorUnrecognized escape sequence
CS1010ErrorNewline in constant
CS1011ErrorEmpty character literal
CS1012ErrorToo many characters in character literal
CS1013ErrorInvalid number
CS1014ErrorA get or set accessor expected
CS1015ErrorAn object, string, or class type expected
CS1016ErrorNamed attribute argument expected
CS1017ErrorCatch clauses cannot follow the general catch clause of a try statement
CS1018ErrorKeyword ‘this’ or ‘base’ expected
CS1019ErrorOverloadable unary operator expected
CS1020ErrorOverloadable binary operator expected
CS1021ErrorIntegral constant is too large
CS1022ErrorType or namespace definition, or end-of-file expected
CS1023ErrorEmbedded statement cannot be a declaration or labeled statement
CS1024ErrorPreprocessor directive expected
CS1025ErrorSingle-line comment or end-of-line expected
CS1026Error) expected
CS1027Error#endif directive expected
CS1028ErrorUnexpected preprocessor directive
CS1029Error#error: ‘{0}’
CS1030Warning#warning: ‘{0}’
CS1031ErrorType expected
CS1032ErrorCannot define/undefine preprocessor symbols after first token in file
CS1035ErrorEnd-of-file found, ‘*/‘ expected
CS1037ErrorOverloadable operator expected
CS1038Error#endregion directive expected
CS1039ErrorUnterminated string literal
CS1040ErrorPreprocessor directives must appear as the first non-whitespace character on a line
CS1041ErrorIdentifier expected; ‘{1}’ is a keyword
CS1043Error{ or ; expected
CS1044ErrorCannot use more than one type in a for, using, fixed, or declaration statement
CS1055ErrorAn add or remove accessor expected
CS1056ErrorUnexpected character ‘{0}’
CS1057Error‘{0}’: static classes cannot contain protected members
CS1058WarningA previous catch clause already catches all exceptions. All non-exceptions thrown will be wrapped in a System.Runtime.CompilerServices.RuntimeWrappedException.
CS1059ErrorThe operand of an increment or decrement operator must be a variable, property or indexer
CS1061Error‘{0}’ does not contain a definition for ‘{1}’ and no accessible extension method ‘{1}’ accepting a first argument of type ‘{0}’ could be found (are you missing a using directive or an assembly reference?)
CS1062WarningThe best overloaded Add method ‘{0}’ for the collection initializer element is obsolete. {1}
CS1063ErrorThe best overloaded Add method ‘{0}’ for the collection initializer element is obsolete. {1}
CS1064WarningThe best overloaded Add method ‘{0}’ for the collection initializer element is obsolete.
CS1065ErrorDefault values are not valid in this context.
CS1066WarningThe default value specified for parameter ‘{0}’ will have no effect because it applies to a member that is used in contexts that do not allow optional arguments
CS1067ErrorPartial declarations of ‘{0}’ must have the same type parameter names and variance modifiers in the same order
CS1068ErrorThe type name ‘{0}’ could not be found in the global namespace. This type has been forwarded to assembly ‘{1}’ Consider adding a reference to that assembly.
CS1069ErrorThe type name ‘{0}’ could not be found in the namespace ‘{1}’. This type has been forwarded to assembly ‘{2}’ Consider adding a reference to that assembly.
CS1070ErrorThe type name ‘{0}’ could not be found. This type has been forwarded to assembly ‘{1}’. Consider adding a reference to that assembly.
CS1072WarningExpected identifier or numeric literal.
CS1073ErrorUnexpected token ‘{0}’
CS1100ErrorMethod ‘{0}’ has a parameter modifier ‘this’ which is not on the first parameter
CS1103ErrorThe first parameter of an extension method cannot be of type ‘{0}’
CS1104ErrorA parameter array cannot be used with ‘this’ modifier on an extension method
CS1105ErrorExtension method must be static
CS1106ErrorExtension method must be defined in a non-generic static class
CS1107ErrorA parameter can only have one ‘{0}’ modifier
CS1109ErrorExtension methods must be defined in a top level static class; {0} is a nested class
CS1110ErrorCannot define a new extension method because the compiler required type ‘{0}’ cannot be found. Are you missing a reference to System.Core.dll?
CS1112ErrorDo not use ‘System.Runtime.CompilerServices.ExtensionAttribute’. Use the ‘this’ keyword instead.
CS1113ErrorExtension method ‘{0}’ defined on value type ‘{1}’ cannot be used to create delegates