In this post, you’ll learn all the C# compiler error and warnings from the code CS9001 to CS9100.
C# Compiler Error Codes CS9001 to CS9100
Error Code | Type | Error/Warning Description |
---|---|---|
CS9001 | Error | Multi-line raw string literals are only allowed in verbatim interpolated strings. |
CS9002 | Error | Multi-line raw string literals must contain at least one line of content. |
CS9003 | Error | Line contains different whitespace than the closing line of the raw string literal: ‘{0}’ versus ‘{1}’ |
CS9004 | Error | Not enough quotes for raw string literal. |
CS9005 | Error | The interpolation must end with the same number of closing braces as the number of ‘$’ characters that the raw string literal started with. |
CS9006 | Error | The interpolated raw string literal does not start with enough ‘$’ characters to allow this many consecutive opening braces as content. |
CS9007 | Error | The interpolated raw string literal does not start with enough ‘$’ characters to allow this many consecutive closing braces as content. |
CS9008 | Error | Sequence of ‘@’ characters is not allowed. A verbatim string or identifier can only have one ‘@’ character and a raw string cannot have any. |
CS9009 | Error | String must start with quote character: “ |
CS9010 | Error | Keyword ‘enum’ cannot be used as a constraint. Did you mean ‘struct, System.Enum’? |
CS9011 | Error | Keyword ‘delegate’ cannot be used as a constraint. Did you mean ‘System.Delegate’? |
CS9012 | Error | Unexpected keyword ‘record’. Did you mean ‘record struct’ or ‘record class’? |
CS9013 | Error | A string ‘null’ constant is not supported as a pattern for ‘{0}’. Use an empty string instead. |
CS9014 | Error | Use of possibly unassigned auto-implemented property ‘{0}’. Consider updating to language version ‘{1}’ to auto-default the property. |
CS9015 | Error | Use of possibly unassigned field ‘{0}’. Consider updating to language version ‘{1}’ to auto-default the field. |
CS9016 | Warning | Use of possibly unassigned auto-implemented property ‘{0}’. Consider updating to language version ‘{1}’ to auto-default the property. |
CS9017 | Warning | Use of possibly unassigned field ‘{0}’. Consider updating to language version ‘{1}’ to auto-default the field. |
CS9018 | Warning | Auto-implemented property ‘{0}’ is read before being explicitly assigned, causing a preceding implicit assignment of ‘default’. |
CS9019 | Warning | Field ‘{0}’ is read before being explicitly assigned, causing a preceding implicit assignment of ‘default’. |
CS9020 | Warning | The ‘this’ object is read before all of its fields have been assigned, causing preceding implicit assignments of ‘default’ to non-explicitly assigned fields. |
CS9021 | Warning | Control is returned to caller before auto-implemented property ‘{0}’ is explicitly assigned, causing a preceding implicit assignment of ‘default’. |
CS9022 | Warning | Control is returned to caller before field ‘{0}’ is explicitly assigned, causing a preceding implicit assignment of ‘default’. |
CS9023 | Error | User-defined operator ‘{0}’ cannot be declared checked |
CS9024 | Error | An ‘implicit’ user-defined conversion operator cannot be declared checked |
CS9025 | Error | The operator ‘{0}’ requires a matching non-checked version of the operator to also be defined |
CS9026 | Error | The input string cannot be converted into the equivalent UTF-8 byte representation. {0} |
CS9027 | Error | Unexpected keyword ‘unchecked’ |
CS9028 | Error | The #line span directive requires space before the first parenthesis, before the character offset, and before the file name |
CS9029 | Error | Types and aliases cannot be named ‘required’. |
CS9030 | Error | ‘{0}’ must be required because it overrides required member ‘{1}’ |
CS9031 | Error | Required member ‘{0}’ cannot be hidden by ‘{1}’. |
CS9032 | Error | Required member ‘{0}’ cannot be less visible or have a setter less visible than the containing type ‘{1}’. |
CS9033 | Error | Do not use ‘System.Runtime.CompilerServices.RequiredMemberAttribute’. Use the ‘required’ keyword on required fields and properties instead. |
CS9034 | Error | Required member ‘{0}’ must be settable. |
CS9035 | Error | Required member ‘{0}’ must be set in the object initializer or attribute constructor. |
CS9036 | Error | Required member ‘{0}’ must be assigned a value, it cannot use a nested member or collection initializer. |
CS9037 | Error | The required members list for ‘{0}’ is malformed and cannot be interpreted. |
CS9038 | Error | The required members list for the base type ‘{0}’ is malformed and cannot be interpreted. To use this constructor, apply the ‘SetsRequiredMembers’ attribute. |
CS9039 | Error | This constructor must add ‘SetsRequiredMembers’ because it chains to a constructor that has that attribute. |
CS9040 | Error | ‘{2}’ cannot satisfy the ‘new()’ constraint on parameter ‘{1}’ in the generic type or or method ‘{0}’ because ‘{2}’ has required members. |
CS9041 | Error | ‘{0}’ requires compiler feature ‘{1}’, which is not supported by this version of the C# compiler. |
CS9042 | Warning | Required member ‘{0}’ should not be attributed with ‘ObsoleteAttribute’ unless the containing type is obsolete or all constructors are obsolete. |
CS9043 | Error | Ref returning properties cannot be required. |
CS9044 | Error | ‘{0}’ does not implement interface member ‘{1}’. ‘{2}’ cannot implicitly implement an inaccessible member. |
CS9045 | Error | Required members are not allowed on the top level of a script or submission. |
CS9046 | Error | One of the parameters of an equality, or inequality operator declared in interface ‘{0}’ must be a type parameter on ‘{0}’ constrained to ‘{0}’ |
CS9047 | Error | Operator ‘{0}’ cannot be applied to operands of type ‘{1}’ and ‘{2}’ that are not UTF-8 byte representations |
CS9048 | Error | The ‘scoped’ modifier can be used for refs and ref struct values only. |
CS9049 | Error | A fixed field must not be a ref field. |
CS9050 | Error | A ref field cannot refer to a ref struct. |
CS9051 | Error | File-local type ‘{0}’ cannot be used in a member signature in non-file-local type ‘{1}’. |
CS9052 | Error | File-local type ‘{0}’ cannot use accessibility modifiers. |
CS9053 | Error | File-local type ‘{0}’ cannot be used as a base type of non-file-local type ‘{1}’. |
CS9054 | Error | File-local type ‘{0}’ must be defined in a top level type; ‘{0}’ is a nested type. |
CS9055 | Error | File-local type ‘{0}’ cannot be used in a ‘global using static’ directive. |
CS9056 | Error | Types and aliases cannot be named ‘file’. |
CS9057 | Warning | The analyzer assembly ‘{0}’ references version ‘{1}’ of the compiler, which is newer than the currently running version ‘{2}’. |
CS9058 | Error | Feature ‘{0}’ is not available in C# 11.0. Please use language version {1} or greater. |
CS9059 | Error | A ref field can only be declared in a ref struct. |
CS9060 | Error | Cannot use a numeric constant or relational pattern on ‘{0}’ because it inherits from or extends ‘INumberBase\<T\>‘. Consider using a type pattern to narrow to a specifc numeric type. |
CS9062 | Error | Types and aliases cannot be named ‘scoped’. |
CS9063 | Error | UnscopedRefAttribute cannot be applied to this item because it is unscoped by default. |
CS9064 | Error | Target runtime doesn’t support ref fields. |
CS9065 | Error | Do not use ‘System.Runtime.CompilerServices.ScopedRefAttribute’. Use the ‘scoped’ keyword instead. |
CS9066 | Error | UnscopedRefAttribute cannot be applied to parameters that have a ‘scoped’ modifier. |
CS9067 | Warning | Analyzer reference ‘{0}’ specified multiple times |
CS9068 | Error | File-local type ‘{0}’ must be declared in a file with a unique path. Path ‘{1}’ is used in multiple files. |
CS9069 | Error | File-local type ‘{0}’ cannot be used because the containing file path cannot be converted into the equivalent UTF-8 byte representation. {1} |
CS9070 | Error | ‘readonly’ is not supported as a parameter modifier. Did you mean ‘in’? |
CS9071 | Error | The namespace ‘{1}’ already contains a definition for ‘{0}’ in this file. |
CS9073 | Warning | The ‘scoped’ modifier of parameter ‘{0}’ doesn’t match target ‘{1}’. |
CS9074 | Warning | The ‘scoped’ modifier of parameter ‘{0}’ doesn’t match overridden or implemented member. |
CS9075 | Error | Cannot return a parameter by reference ‘{0}’ because it is scoped to the current method |
CS9076 | Error | Cannot return by reference a member of parameter ‘{0}’ because it is scoped to the current method |
CS9077 | Error | Cannot return a parameter by reference ‘{0}’ through a ref parameter; it can only be returned in a return statement |
CS9078 | Error | Cannot return by reference a member of parameter ‘{0}’ through a ref parameter; it can only be returned in a return statement |
CS9079 | Error | Cannot ref-assign ‘{1}’ to ‘{0}’ because ‘{1}’ can only escape the current method through a return statement. |