C# Compiler Error Codes CS9001 to CS9100

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 CodeTypeError/Warning Description
CS9001ErrorMulti-line raw string literals are only allowed in verbatim interpolated strings.
CS9002ErrorMulti-line raw string literals must contain at least one line of content.
CS9003ErrorLine contains different whitespace than the closing line of the raw string literal: ‘{0}’ versus ‘{1}’
CS9004ErrorNot enough quotes for raw string literal.
CS9005ErrorThe interpolation must end with the same number of closing braces as the number of ‘$’ characters that the raw string literal started with.
CS9006ErrorThe interpolated raw string literal does not start with enough ‘$’ characters to allow this many consecutive opening braces as content.
CS9007ErrorThe interpolated raw string literal does not start with enough ‘$’ characters to allow this many consecutive closing braces as content.
CS9008ErrorSequence of ‘@’ characters is not allowed. A verbatim string or identifier can only have one ‘@’ character and a raw string cannot have any.
CS9009ErrorString must start with quote character: “
CS9010ErrorKeyword ‘enum’ cannot be used as a constraint. Did you mean ‘struct, System.Enum’?
CS9011ErrorKeyword ‘delegate’ cannot be used as a constraint. Did you mean ‘System.Delegate’?
CS9012ErrorUnexpected keyword ‘record’. Did you mean ‘record struct’ or ‘record class’?
CS9013ErrorA string ‘null’ constant is not supported as a pattern for ‘{0}’. Use an empty string instead.
CS9014ErrorUse of possibly unassigned auto-implemented property ‘{0}’. Consider updating to language version ‘{1}’ to auto-default the property.
CS9015ErrorUse of possibly unassigned field ‘{0}’. Consider updating to language version ‘{1}’ to auto-default the field.
CS9016WarningUse of possibly unassigned auto-implemented property ‘{0}’. Consider updating to language version ‘{1}’ to auto-default the property.
CS9017WarningUse of possibly unassigned field ‘{0}’. Consider updating to language version ‘{1}’ to auto-default the field.
CS9018WarningAuto-implemented property ‘{0}’ is read before being explicitly assigned, causing a preceding implicit assignment of ‘default’.
CS9019WarningField ‘{0}’ is read before being explicitly assigned, causing a preceding implicit assignment of ‘default’.
CS9020WarningThe ‘this’ object is read before all of its fields have been assigned, causing preceding implicit assignments of ‘default’ to non-explicitly assigned fields.
CS9021WarningControl is returned to caller before auto-implemented property ‘{0}’ is explicitly assigned, causing a preceding implicit assignment of ‘default’.
CS9022WarningControl is returned to caller before field ‘{0}’ is explicitly assigned, causing a preceding implicit assignment of ‘default’.
CS9023ErrorUser-defined operator ‘{0}’ cannot be declared checked
CS9024ErrorAn ‘implicit’ user-defined conversion operator cannot be declared checked
CS9025ErrorThe operator ‘{0}’ requires a matching non-checked version of the operator to also be defined
CS9026ErrorThe input string cannot be converted into the equivalent UTF-8 byte representation. {0}
CS9027ErrorUnexpected keyword ‘unchecked’
CS9028ErrorThe #line span directive requires space before the first parenthesis, before the character offset, and before the file name
CS9029ErrorTypes and aliases cannot be named ‘required’.
CS9030Error‘{0}’ must be required because it overrides required member ‘{1}’
CS9031ErrorRequired member ‘{0}’ cannot be hidden by ‘{1}’.
CS9032ErrorRequired member ‘{0}’ cannot be less visible or have a setter less visible than the containing type ‘{1}’.
CS9033ErrorDo not use ‘System.Runtime.CompilerServices.RequiredMemberAttribute’. Use the ‘required’ keyword on required fields and properties instead.
CS9034ErrorRequired member ‘{0}’ must be settable.
CS9035ErrorRequired member ‘{0}’ must be set in the object initializer or attribute constructor.
CS9036ErrorRequired member ‘{0}’ must be assigned a value, it cannot use a nested member or collection initializer.
CS9037ErrorThe required members list for ‘{0}’ is malformed and cannot be interpreted.
CS9038ErrorThe required members list for the base type ‘{0}’ is malformed and cannot be interpreted. To use this constructor, apply the ‘SetsRequiredMembers’ attribute.
CS9039ErrorThis constructor must add ‘SetsRequiredMembers’ because it chains to a constructor that has that attribute.
CS9040Error‘{2}’ cannot satisfy the ‘new()’ constraint on parameter ‘{1}’ in the generic type or or method ‘{0}’ because ‘{2}’ has required members.
CS9041Error‘{0}’ requires compiler feature ‘{1}’, which is not supported by this version of the C# compiler.
CS9042WarningRequired member ‘{0}’ should not be attributed with ‘ObsoleteAttribute’ unless the containing type is obsolete or all constructors are obsolete.
CS9043ErrorRef returning properties cannot be required.
CS9044Error‘{0}’ does not implement interface member ‘{1}’. ‘{2}’ cannot implicitly implement an inaccessible member.
CS9045ErrorRequired members are not allowed on the top level of a script or submission.
CS9046ErrorOne of the parameters of an equality, or inequality operator declared in interface ‘{0}’ must be a type parameter on ‘{0}’ constrained to ‘{0}’
CS9047ErrorOperator ‘{0}’ cannot be applied to operands of type ‘{1}’ and ‘{2}’ that are not UTF-8 byte representations
CS9048ErrorThe ‘scoped’ modifier can be used for refs and ref struct values only.
CS9049ErrorA fixed field must not be a ref field.
CS9050ErrorA ref field cannot refer to a ref struct.
CS9051ErrorFile-local type ‘{0}’ cannot be used in a member signature in non-file-local type ‘{1}’.
CS9052ErrorFile-local type ‘{0}’ cannot use accessibility modifiers.
CS9053ErrorFile-local type ‘{0}’ cannot be used as a base type of non-file-local type ‘{1}’.
CS9054ErrorFile-local type ‘{0}’ must be defined in a top level type; ‘{0}’ is a nested type.
CS9055ErrorFile-local type ‘{0}’ cannot be used in a ‘global using static’ directive.
CS9056ErrorTypes and aliases cannot be named ‘file’.
CS9057WarningThe analyzer assembly ‘{0}’ references version ‘{1}’ of the compiler, which is newer than the currently running version ‘{2}’.
CS9058ErrorFeature ‘{0}’ is not available in C# 11.0. Please use language version {1} or greater.
CS9059ErrorA ref field can only be declared in a ref struct.
CS9060ErrorCannot 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.
CS9062ErrorTypes and aliases cannot be named ‘scoped’.
CS9063ErrorUnscopedRefAttribute cannot be applied to this item because it is unscoped by default.
CS9064ErrorTarget runtime doesn’t support ref fields.
CS9065ErrorDo not use ‘System.Runtime.CompilerServices.ScopedRefAttribute’. Use the ‘scoped’ keyword instead.
CS9066ErrorUnscopedRefAttribute cannot be applied to parameters that have a ‘scoped’ modifier.
CS9067WarningAnalyzer reference ‘{0}’ specified multiple times
CS9068ErrorFile-local type ‘{0}’ must be declared in a file with a unique path. Path ‘{1}’ is used in multiple files.
CS9069ErrorFile-local type ‘{0}’ cannot be used because the containing file path cannot be converted into the equivalent UTF-8 byte representation. {1}
CS9070Error‘readonly’ is not supported as a parameter modifier. Did you mean ‘in’?
CS9071ErrorThe namespace ‘{1}’ already contains a definition for ‘{0}’ in this file.
CS9073WarningThe ‘scoped’ modifier of parameter ‘{0}’ doesn’t match target ‘{1}’.
CS9074WarningThe ‘scoped’ modifier of parameter ‘{0}’ doesn’t match overridden or implemented member.
CS9075ErrorCannot return a parameter by reference ‘{0}’ because it is scoped to the current method
CS9076ErrorCannot return by reference a member of parameter ‘{0}’ because it is scoped to the current method
CS9077ErrorCannot return a parameter by reference ‘{0}’ through a ref parameter; it can only be returned in a return statement
CS9078ErrorCannot return by reference a member of parameter ‘{0}’ through a ref parameter; it can only be returned in a return statement
CS9079ErrorCannot ref-assign ‘{1}’ to ‘{0}’ because ‘{1}’ can only escape the current method through a return statement.

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