In this post, you’ll learn all the C# compiler error and warnings from the code CS7001 to CS8000.
C# Compiler Error Codes CS7001 to CS8000
Error Code | Type | Error/Warning Description |
---|---|---|
CS7000 | Error | Unexpected use of an aliased name |
CS7002 | Error | Unexpected use of a generic name |
CS7003 | Error | Unexpected use of an unbound generic name |
CS7006 | Error | Expressions and statements can only occur in a method body |
CS7007 | Error | A ‘using static’ directive can only be applied to types; ‘{0}’ is a namespace not a type. Consider a ‘using namespace’ directive instead |
CS7008 | Error | The assembly name ‘{0}’ is reserved and cannot be used as a reference in an interactive session |
CS7009 | Error | Cannot use #r after first token in file |
CS7010 | Error | Quoted file name expected |
CS7011 | Error | #r is only allowed in scripts |
CS7012 | Error | The name ‘{0}’ does not exist in the current context (are you missing a reference to assembly ‘{1}’?) |
CS7013 | Error | Name ‘{0}’ exceeds the maximum length allowed in metadata. |
CS7014 | Error | Attributes are not valid in this context. |
CS7015 | Error | ‘extern alias’ is not valid in this context |
CS7016 | Error | Alias ‘{0}’ conflicts with {1} definition |
CS7017 | Error | Member definition, statement, or end-of-file expected |
CS7018 | Error | Expected a script (.csx file) but none specified |
CS7019 | Error | Type of ‘{0}’ cannot be inferred since its initializer directly or indirectly refers to the definition. |
CS7020 | Error | Cannot use ‘yield’ in top-level script code |
CS7021 | Error | Cannot declare namespace in script code |
CS7022 | Warning | The entry point of the program is global code; ignoring ‘{0}’ entry point. |
CS7023 | Warning | The second operand of an ‘is’ or ‘as’ operator may not be static type ‘{0}’ |
CS7024 | Error | Delegate ‘{0}’ has no invoke method or an invoke method with a return type or parameter types that are not supported. |
CS7025 | Error | Inconsistent accessibility: event type ‘{1}’ is less accessible than event ‘{0}’ |
CS7026 | Error | Assembly and module attributes are not allowed in this context |
CS7027 | Error | Error signing output with public key from file ‘{0}’ — {1} |
CS7028 | Error | Error signing output with public key from container ‘{0}’ — {1} |
CS7029 | Error | Friend access was granted by ‘{0}’, but the strong name signing state of the output assembly does not match that of the granting assembly. |
CS7030 | Error | Cannot pass null for friend assembly name |
CS7032 | Error | Key file ‘{0}’ is missing the private key needed for signing |
CS7033 | Warning | Delay signing was specified and requires a public key, but no public key was specified |
CS7034 | Error | The specified version string does not conform to the required format – major[.minor[.build[.revision]]] |
CS7035 | Warning | The specified version string does not conform to the recommended format – major.minor.build.revision |
CS7036 | Error | There is no argument given that corresponds to the required parameter ‘{0}’ of ‘{1}’ |
CS7038 | Error | Failed to emit module ‘{0}’: {1} |
CS7041 | Error | Each linked resource and module must have a unique filename. Filename ‘{0}’ is specified more than once in this assembly |
CS7042 | Error | The DllImport attribute cannot be applied to a method that is generic or contained in a generic method or type. |
CS7043 | Error | Cannot update ‘{0}’; attribute ‘{1}’ is missing. |
CS7045 | Error | Parameter not valid for the specified unmanaged type. |
CS7046 | Error | Attribute parameter ‘{0}’ must be specified. |
CS7047 | Error | Attribute parameter ‘{0}’ or ‘{1}’ must be specified. |
CS7048 | Error | First argument to a security attribute must be a valid SecurityAction |
CS7049 | Error | Security attribute ‘{0}’ has an invalid SecurityAction value ‘{1}’ |
CS7050 | Error | SecurityAction value ‘{0}’ is invalid for security attributes applied to an assembly |
CS7051 | Error | SecurityAction value ‘{0}’ is invalid for security attributes applied to a type or a method |
CS7052 | Error | SecurityAction value ‘{0}’ is invalid for PrincipalPermission attribute |
CS7053 | Error | An expression tree may not contain ‘{0}’ |
CS7054 | Error | Unmanaged type ‘{0}’ not valid for fields. |
CS7055 | Error | Unmanaged type ‘{0}’ is only valid for fields. |
CS7056 | Error | Unable to resolve file path ‘{0}’ specified for the named argument ‘{1}’ for PermissionSet attribute |
CS7057 | Error | Error reading file ‘{0}’ specified for the named argument ‘{1}’ for PermissionSet attribute: ‘{2}’ |
CS7058 | Error | The specified version string does not conform to the required format – major.minor.build.revision (without wildcards) |
CS7059 | Error | Executables cannot be satellite assemblies; culture should always be empty |
CS7061 | Error | Duplicate ‘{0}’ attribute in ‘{1}’ |
CS7064 | Error | Error opening icon file {0} — {1} |
CS7065 | Error | Error building Win32 resources — {0} |
CS7067 | Error | Attribute constructor parameter ‘{0}’ is optional, but no default parameter value was specified. |
CS7068 | Error | Reference to type ‘{0}’ claims it is defined in this assembly, but it is not defined in source or any added modules |
CS7069 | Error | Reference to type ‘{0}’ claims it is defined in ‘{1}’, but it could not be found |
CS7070 | Error | Security attribute ‘{0}’ is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations. |
CS7071 | Error | Assembly reference ‘{0}’ is invalid and cannot be resolved |
CS7079 | Error | The type ‘{0}’ is defined in a module that has not been added. You must add the module ‘{1}’. |
CS7080 | Warning | The CallerMemberNameAttribute applied to parameter ‘{0}’ will have no effect. It is overridden by the CallerFilePathAttribute. |
CS7081 | Warning | The CallerMemberNameAttribute applied to parameter ‘{0}’ will have no effect. It is overridden by the CallerLineNumberAttribute. |
CS7082 | Warning | The CallerFilePathAttribute applied to parameter ‘{0}’ will have no effect. It is overridden by the CallerLineNumberAttribute. |
CS7083 | Error | Expression must be implicitly convertible to Boolean or its type ‘{0}’ must define operator ‘{1}’. |
CS7084 | Error | A Windows Runtime event may not be passed as an out or ref parameter. |
CS7086 | Error | Module name ‘{0}’ stored in ‘{1}’ must match its filename. |
CS7087 | Error | Invalid module name: {0} |
CS7088 | Error | Invalid ‘{0}’ value: ‘{1}’. |
CS7089 | Error | AppConfigPath must be absolute. |
CS7090 | Warning | Attribute ‘{0}’ from module ‘{1}’ will be ignored in favor of the instance appearing in source |
CS7091 | Error | Attribute ‘{0}’ given in a source file conflicts with option ‘{1}’. |
CS7092 | Error | A fixed buffer may only have one dimension. |
CS7093 | Error | Cannot read config file ‘{0}’ — ‘{1}’ |
CS7094 | Error | Cannot await in the filter expression of a catch clause |
CS7095 | Warning | Filter expression is a constant ‘true’, consider removing the filter |
CS7096 | Error | Cannot continue since the edit includes a reference to an embedded type: ‘{0}’. |
CS7098 | Error | Linked netmodule metadata must provide a full PE image: ‘{0}’. |
CS7099 | Error | Metadata references are not supported. |
CS7100 | Error | Assembly culture strings may not contain embedded NUL characters. |
CS7101 | Error | Member ‘{0}’ added during the current debug session can only be accessed from within its declaring assembly ‘{1}’. |
CS7102 | Error | Compilation options ‘{0}’ and ‘{1}’ can’t both be specified at the same time. |
CS7103 | Error | Unable to read debug information of method ‘{0}’ (token 0x{1:X8}) from assembly ‘{2}’ |