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 Code | Type | Error/Warning Description |
---|---|---|
CS1001 | Error | Identifier expected |
CS1002 | Error | ; expected |
CS1003 | Error | Syntax error, ‘{0}’ expected |
CS1004 | Error | Duplicate ‘{0}’ modifier |
CS1007 | Error | Property accessor already defined |
CS1008 | Error | Type byte, sbyte, short, ushort, int, uint, long, or ulong expected |
CS1009 | Error | Unrecognized escape sequence |
CS1010 | Error | Newline in constant |
CS1011 | Error | Empty character literal |
CS1012 | Error | Too many characters in character literal |
CS1013 | Error | Invalid number |
CS1014 | Error | A get or set accessor expected |
CS1015 | Error | An object, string, or class type expected |
CS1016 | Error | Named attribute argument expected |
CS1017 | Error | Catch clauses cannot follow the general catch clause of a try statement |
CS1018 | Error | Keyword ‘this’ or ‘base’ expected |
CS1019 | Error | Overloadable unary operator expected |
CS1020 | Error | Overloadable binary operator expected |
CS1021 | Error | Integral constant is too large |
CS1022 | Error | Type or namespace definition, or end-of-file expected |
CS1023 | Error | Embedded statement cannot be a declaration or labeled statement |
CS1024 | Error | Preprocessor directive expected |
CS1025 | Error | Single-line comment or end-of-line expected |
CS1026 | Error | ) expected |
CS1027 | Error | #endif directive expected |
CS1028 | Error | Unexpected preprocessor directive |
CS1029 | Error | #error: ‘{0}’ |
CS1030 | Warning | #warning: ‘{0}’ |
CS1031 | Error | Type expected |
CS1032 | Error | Cannot define/undefine preprocessor symbols after first token in file |
CS1035 | Error | End-of-file found, ‘*/‘ expected |
CS1037 | Error | Overloadable operator expected |
CS1038 | Error | #endregion directive expected |
CS1039 | Error | Unterminated string literal |
CS1040 | Error | Preprocessor directives must appear as the first non-whitespace character on a line |
CS1041 | Error | Identifier expected; ‘{1}’ is a keyword |
CS1043 | Error | { or ; expected |
CS1044 | Error | Cannot use more than one type in a for, using, fixed, or declaration statement |
CS1055 | Error | An add or remove accessor expected |
CS1056 | Error | Unexpected character ‘{0}’ |
CS1057 | Error | ‘{0}’: static classes cannot contain protected members |
CS1058 | Warning | A previous catch clause already catches all exceptions. All non-exceptions thrown will be wrapped in a System.Runtime.CompilerServices.RuntimeWrappedException. |
CS1059 | Error | The operand of an increment or decrement operator must be a variable, property or indexer |
CS1061 | Error | ‘{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?) |
CS1062 | Warning | The best overloaded Add method ‘{0}’ for the collection initializer element is obsolete. {1} |
CS1063 | Error | The best overloaded Add method ‘{0}’ for the collection initializer element is obsolete. {1} |
CS1064 | Warning | The best overloaded Add method ‘{0}’ for the collection initializer element is obsolete. |
CS1065 | Error | Default values are not valid in this context. |
CS1066 | Warning | The 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 |
CS1067 | Error | Partial declarations of ‘{0}’ must have the same type parameter names and variance modifiers in the same order |
CS1068 | Error | The 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. |
CS1069 | Error | The 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. |
CS1070 | Error | The type name ‘{0}’ could not be found. This type has been forwarded to assembly ‘{1}’. Consider adding a reference to that assembly. |
CS1072 | Warning | Expected identifier or numeric literal. |
CS1073 | Error | Unexpected token ‘{0}’ |
CS1100 | Error | Method ‘{0}’ has a parameter modifier ‘this’ which is not on the first parameter |
CS1103 | Error | The first parameter of an extension method cannot be of type ‘{0}’ |
CS1104 | Error | A parameter array cannot be used with ‘this’ modifier on an extension method |
CS1105 | Error | Extension method must be static |
CS1106 | Error | Extension method must be defined in a non-generic static class |
CS1107 | Error | A parameter can only have one ‘{0}’ modifier |
CS1109 | Error | Extension methods must be defined in a top level static class; {0} is a nested class |
CS1110 | Error | Cannot define a new extension method because the compiler required type ‘{0}’ cannot be found. Are you missing a reference to System.Core.dll? |
CS1112 | Error | Do not use ‘System.Runtime.CompilerServices.ExtensionAttribute’. Use the ‘this’ keyword instead. |
CS1113 | Error | Extension method ‘{0}’ defined on value type ‘{1}’ cannot be used to create delegates |