C# Compiler Error Codes CS1501 to CS2000

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

C# Compiler Error Codes CS1501 to CS2000

Error CodeTypeError/Warning Description
CS1501ErrorNo overload for method ‘{0}’ takes {1} arguments
CS1503ErrorArgument {0}: cannot convert from ‘{1}’ to ‘{2}’
CS1504ErrorSource file ‘{0}’ could not be opened — {1}
CS1507ErrorCannot link resource files when building a module
CS1508ErrorResource identifier ‘{0}’ has already been used in this assembly
CS1509ErrorThe referenced file ‘{0}’ is not an assembly
CS1510ErrorA ref or out value must be an assignable variable
CS1511ErrorKeyword ‘base’ is not available in a static method
CS1512ErrorKeyword ‘base’ is not available in the current context
CS1513Error} expected
CS1514Error{ expected
CS1515Error‘in’ expected
CS1517ErrorInvalid preprocessor expression
CS1519ErrorInvalid token ‘{0}’ in class, record, struct, or interface member declaration
CS1520ErrorMethod must have a return type
CS1521ErrorInvalid base type
CS1522WarningEmpty switch block
CS1524ErrorExpected catch or finally
CS1525ErrorInvalid expression term ‘{0}’
CS1526ErrorA new expression requires an argument list or (), [], or {} after type
CS1527ErrorElements defined in a namespace cannot be explicitly declared as private, protected, protected internal, or private protected
CS1528ErrorExpected ; or = (cannot specify constructor arguments in declaration)
CS1529ErrorA using clause must precede all other elements defined in the namespace except extern alias declarations
CS1534ErrorOverloaded binary operator ‘{0}’ takes two parameters
CS1535ErrorOverloaded unary operator ‘{0}’ takes one parameter
CS1536ErrorInvalid parameter type ‘void’
CS1537ErrorThe using alias ‘{0}’ appeared previously in this namespace
CS1540ErrorCannot access protected member ‘{0}’ via a qualifier of type ‘{1}’; the qualifier must be of type ‘{2}’ (or derived from it)
CS1542Error‘{0}’ cannot be added to this assembly because it already is an assembly
CS1545ErrorProperty, indexer, or event ‘{0}’ is not supported by the language; try directly calling accessor methods ‘{1}’ or ‘{2}’
CS1546ErrorProperty, indexer, or event ‘{0}’ is not supported by the language; try directly calling accessor method ‘{1}’
CS1547ErrorKeyword ‘void’ cannot be used in this context
CS1551ErrorIndexers must have at least one parameter
CS1552ErrorArray type specifier, [], must appear before parameter name
CS1553ErrorDeclaration is not valid; use ‘{0} operator \<dest-type\> (…’ instead
CS1555ErrorCould not find ‘{0}’ specified for Main method
CS1556Error‘{0}’ specified for Main method must be a non-generic class, record, struct, or interface
CS1558Error‘{0}’ does not have a suitable static ‘Main’ method
CS1562ErrorOutputs without source must have the /out option specified
CS1564ErrorConflicting options specified: Win32 resource file; Win32 manifest
CS1565ErrorConflicting options specified: Win32 resource file; Win32 icon
CS1566ErrorError reading resource ‘{0}’ — ‘{1}’
CS1569ErrorError writing to XML documentation file: {0}
CS1570WarningXML comment has badly formed XML — ‘{0}’
CS1571WarningXML comment has a duplicate param tag for ‘{0}’
CS1572WarningXML comment has a param tag for ‘{0}’, but there is no parameter by that name
CS1573WarningParameter ‘{0}’ has no matching param tag in the XML comment for ‘{1}’ (but other parameters do)
CS1574WarningXML comment has cref attribute ‘{0}’ that could not be resolved
CS1575ErrorA stackalloc expression requires [] after type
CS1576ErrorThe line number specified for #line directive is missing or invalid
CS1578ErrorQuoted file name, single-line comment or end-of-line expected
CS1579Errorforeach statement cannot operate on variables of type ‘{0}’ because ‘{0}’ does not contain a public instance or extension definition for ‘{1}’
CS1580WarningInvalid type for parameter {0} in XML comment cref attribute: ‘{1}’
CS1581WarningInvalid return type in XML comment cref attribute
CS1583ErrorError reading Win32 resources — {0}
CS1584WarningXML comment has syntactically incorrect cref attribute ‘{0}’
CS1585ErrorMember modifier ‘{0}’ must precede the member type and name
CS1586ErrorArray creation must have array size or array initializer
CS1587WarningXML comment is not placed on a valid language element
CS1589WarningUnable to include XML fragment ‘{1}’ of file ‘{0}’ — {2}
CS1590WarningInvalid XML include element — {0}
CS1591WarningMissing XML comment for publicly visible type or member ‘{0}’
CS1592WarningBadly formed XML in included comments file — ‘{0}’
CS1593ErrorDelegate ‘{0}’ does not take {1} arguments
CS1597ErrorSemicolon after method or accessor block is not valid
CS1599ErrorThe return type of a method, delegate, or function pointer cannot be ‘{0}’
CS1600ErrorCompilation cancelled by user
CS1601ErrorCannot make reference to variable of type ‘{0}’
CS1604ErrorCannot assign to ‘{0}’ because it is read-only
CS1605ErrorCannot use ‘{0}’ as a ref or out value because it is read-only
CS1607Warning
CS1608ErrorThe RequiredAttribute attribute is not permitted on C# types
CS1609ErrorModifiers cannot be placed on event accessor declarations
CS1611ErrorThe params parameter cannot be declared as {0}
CS1612ErrorCannot modify the return value of ‘{0}’ because it is not a variable
CS1613ErrorThe managed coclass wrapper class ‘{0}’ for interface ‘{1}’ cannot be found (are you missing an assembly reference?)
CS1614Error‘{0}’ is ambiguous between ‘{1}’ and ‘{2}’. Either use ‘@{0}’ or explicitly include the ‘Attribute’ suffix.
CS1615ErrorArgument {0} may not be passed with the ‘{1}’ keyword
CS1616WarningOption ‘{0}’ overrides attribute ‘{1}’ given in a source file or added module
CS1617ErrorInvalid option ‘{0}’ for /langversion. Use ‘/langversion:?’ to list supported values.
CS1618ErrorCannot create delegate with ‘{0}’ because it or a method it overrides has a Conditional attribute
CS1619ErrorCannot create temporary file — {0}
CS1620ErrorArgument {0} must be passed with the ‘{1}’ keyword
CS1621ErrorThe yield statement cannot be used inside an anonymous method or lambda expression
CS1622ErrorCannot return a value from an iterator. Use the yield return statement to return a value, or yield break to end the iteration.
CS1623ErrorIterators cannot have ref, in or out parameters
CS1624ErrorThe body of ‘{0}’ cannot be an iterator block because ‘{1}’ is not an iterator interface type
CS1625ErrorCannot yield in the body of a finally clause
CS1626ErrorCannot yield a value in the body of a try block with a catch clause
CS1627ErrorExpression expected after yield return
CS1628ErrorCannot use ref, out, or in parameter ‘{0}’ inside an anonymous method, lambda expression, query expression, or local function
CS1629ErrorUnsafe code may not appear in iterators
CS1631ErrorCannot yield a value in the body of a catch clause
CS1632ErrorControl cannot leave the body of an anonymous method or lambda expression
CS1633WarningUnrecognized #pragma directive
CS1634WarningExpected ‘disable’ or ‘restore’
CS1635WarningCannot restore warning ‘CS{0}’ because it was disabled globally
CS1636Error__arglist is not allowed in the parameter list of iterators
CS1637ErrorIterators cannot have unsafe parameters or yield types
CS1639ErrorThe managed coclass wrapper class signature ‘{0}’ for interface ‘{1}’ is not a valid class name signature
CS1640Errorforeach statement cannot operate on variables of type ‘{0}’ because it implements multiple instantiations of ‘{1}’; try casting to a specific interface instantiation
CS1641ErrorA fixed size buffer field must have the array size specifier after the field name
CS1642ErrorFixed size buffer fields may only be members of structs
CS1643ErrorNot all code paths return a value in {0} of type ‘{1}’
CS1645WarningFeature ‘{0}’ is not part of the standardized ISO C# language specification, and may not be accepted by other compilers
CS1646ErrorKeyword, identifier, or string expected after verbatim specifier: @
CS1648ErrorMembers of readonly field ‘{0}’ cannot be modified (except in a constructor or a variable initializer)
CS1649ErrorMembers of readonly field ‘{0}’ cannot be used as a ref or out value (except in a constructor)
CS1650ErrorFields of static readonly field ‘{0}’ cannot be assigned to (except in a static constructor or a variable initializer)
CS1651ErrorFields of static readonly field ‘{0}’ cannot be used as a ref or out value (except in a static constructor)
CS1654ErrorCannot modify members of ‘{0}’ because it is a ‘{1}’
CS1655ErrorCannot use fields of ‘{0}’ as a ref or out value because it is a ‘{1}’
CS1656ErrorCannot assign to ‘{0}’ because it is a ‘{1}’
CS1657ErrorCannot use ‘{0}’ as a ref or out value because it is a ‘{1}’
CS1658Warning{0}. See also error CS{1}.
CS1660ErrorCannot convert {0} to type ‘{1}’ because it is not a delegate type
CS1661ErrorCannot convert {0} to type ‘{1}’ because the parameter types do not match the delegate parameter types
CS1662ErrorCannot convert {0} to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type
CS1663ErrorFixed size buffer type must be one of the following: bool, byte, short, int, long, char, sbyte, ushort, uint, ulong, float or double
CS1664ErrorFixed size buffer of length {0} and type ‘{1}’ is too big
CS1665ErrorFixed size buffers must have a length greater than zero
CS1666ErrorYou cannot use fixed size buffers contained in unfixed expressions. Try using the fixed statement.
CS1667ErrorAttribute ‘{0}’ is not valid on property or event accessors. It is only valid on ‘{1}’ declarations.
CS1668WarningInvalid search path ‘{0}’ specified in ‘{1}’ — ‘{2}’
CS1669Error__arglist is not valid in this context
CS1670Errorparams is not valid in this context
CS1671ErrorA namespace declaration cannot have modifiers or attributes
CS1672ErrorInvalid option ‘{0}’ for /platform; must be anycpu, x86, Itanium, arm, arm64 or x64
CS1673ErrorAnonymous methods, lambda expressions, query expressions, and local functions inside structs cannot access instance members of ‘this’. Consider copying ‘this’ to a local variable outside the anonymous method, lambda expression, query expression, or local function and using the local instead.
CS1674Error‘{0}’: type used in a using statement must be implicitly convertible to ‘System.IDisposable’.
CS1676ErrorParameter {0} must be declared with the ‘{1}’ keyword
CS1677ErrorParameter {0} should not be declared with the ‘{1}’ keyword
CS1678ErrorParameter {0} is declared as type ‘{1}{2}’ but should be ‘{3}{4}’
CS1679ErrorInvalid extern alias for ‘/reference’; ‘{0}’ is not a valid identifier
CS1680ErrorInvalid reference alias option: ‘{0}=’ — missing filename
CS1681ErrorYou cannot redefine the global extern alias
CS1685WarningThe predefined type ‘{0}’ is defined in multiple assemblies in the global alias; using definition from ‘{1}’
CS1686ErrorLocal ‘{0}’ or its members cannot have their address taken and be used inside an anonymous method or lambda expression
CS1687WarningSource file has exceeded the limit of 16,707,565 lines representable in the PDB; debug information will be incorrect
CS1688ErrorCannot convert anonymous method block without a parameter list to delegate type ‘{0}’ because it has one or more out parameters
CS1689ErrorAttribute ‘{0}’ is only valid on methods or attribute classes
CS1690WarningAccessing a member on ‘{0}’ may cause a runtime exception because it is a field of a marshal-by-reference class
CS1692WarningInvalid number
CS1695WarningInvalid #pragma checksum syntax; should be #pragma checksum “filename” “{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}” “XXXX…”
CS1696WarningSingle-line comment or end-of-line expected
CS1697WarningDifferent checksum values given for ‘{0}’
CS1700WarningAssembly reference ‘{0}’ is invalid and cannot be resolved
CS1701WarningAssuming assembly reference ‘{0}’ used by ‘{1}’ matches identity ‘{2}’ of ‘{3}’, you may need to supply runtime policy
CS1702WarningAssuming assembly reference ‘{0}’ used by ‘{1}’ matches identity ‘{2}’ of ‘{3}’, you may need to supply runtime policy
CS1703ErrorMultiple assemblies with equivalent identity have been imported: ‘{0}’ and ‘{1}’. Remove one of the duplicate references.
CS1704ErrorAn assembly with the same simple name ‘{0}’ has already been imported. Try removing one of the references (e.g. ‘{1}’) or sign them to enable side-by-side.
CS1705ErrorAssembly ‘{0}’ with identity ‘{1}’ uses ‘{2}’ which has a higher version than referenced assembly ‘{3}’ with identity ‘{4}’
CS1708ErrorFixed size buffers can only be accessed through locals or fields
CS1710WarningXML comment has a duplicate typeparam tag for ‘{0}’
CS1711WarningXML comment has a typeparam tag for ‘{0}’, but there is no type parameter by that name
CS1712WarningType parameter ‘{0}’ has no matching typeparam tag in the XML comment on ‘{1}’ (but other type parameters do)
CS1715Error‘{0}’: type must be ‘{2}’ to match overridden member ‘{1}’
CS1716ErrorDo not use ‘System.Runtime.CompilerServices.FixedBuffer’ attribute. Use the ‘fixed’ field modifier instead.
CS1717WarningAssignment made to same variable; did you mean to assign something else?
CS1718WarningComparison made to same variable; did you mean to compare something else?
CS1719ErrorError opening Win32 resource file ‘{0}’ — ‘{1}’
CS1720WarningExpression will always cause a System.NullReferenceException because the default value of ‘{0}’ is null
CS1721ErrorClass ‘{0}’ cannot have multiple base classes: ‘{1}’ and ‘{2}’
CS1722ErrorBase class ‘{0}’ must come before any interfaces
CS1723WarningXML comment has cref attribute ‘{0}’ that refers to a type parameter
CS1725ErrorFriend assembly reference ‘{0}’ is invalid. InternalsVisibleTo declarations cannot have a version, culture, public key token, or processor architecture specified.
CS1726ErrorFriend assembly reference ‘{0}’ is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.
CS1728ErrorCannot bind delegate to ‘{0}’ because it is a member of ‘System.Nullable\<T\>‘
CS1729Error‘{0}’ does not contain a constructor that takes {1} arguments
CS1730ErrorAssembly and module attributes must precede all other elements defined in a file except using clauses and extern alias declarations
CS1733ErrorExpected expression
CS1734WarningXML comment on ‘{1}’ has a paramref tag for ‘{0}’, but there is no parameter by that name
CS1735WarningXML comment on ‘{1}’ has a typeparamref tag for ‘{0}’, but there is no type parameter by that name
CS1736ErrorDefault parameter value for ‘{0}’ must be a compile-time constant
CS1737ErrorOptional parameters must appear after all required parameters
CS1738ErrorNamed argument specifications must appear after all fixed arguments have been specified. Please use language version {0} or greater to allow non-trailing named arguments.
CS1739ErrorThe best overload for ‘{0}’ does not have a parameter named ‘{1}’
CS1740ErrorNamed argument ‘{0}’ cannot be specified multiple times
CS1741ErrorA ref or out parameter cannot have a default value
CS1742ErrorAn array access may not have a named argument specifier
CS1743ErrorCannot specify a default value for the ‘this’ parameter
CS1744ErrorNamed argument ‘{0}’ specifies a parameter for which a positional argument has already been given
CS1745ErrorCannot specify default parameter value in conjunction with DefaultParameterAttribute or OptionalAttribute
CS1746ErrorThe delegate ‘{0}’ does not have a parameter named ‘{1}’
CS1747ErrorCannot embed interop types from assembly ‘{0}’ because it is missing the ‘{1}’ attribute.
CS1748ErrorCannot find the interop type that matches the embedded interop type ‘{0}’. Are you missing an assembly reference?
CS1750ErrorA value of type ‘{0}’ cannot be used as a default parameter because there are no standard conversions to type ‘{1}’
CS1751ErrorCannot specify a default value for a parameter array
CS1752ErrorInterop type ‘{0}’ cannot be embedded. Use the applicable interface instead.
CS1754ErrorType ‘{0}’ cannot be embedded because it is a nested type. Consider setting the ‘Embed Interop Types’ property to false.
CS1756ErrorInterop type ‘{0}’ cannot be embedded because it is missing the required ‘{1}’ attribute.
CS1757ErrorEmbedded interop struct ‘{0}’ can contain only public instance fields.
CS1758ErrorCannot embed interop type ‘{0}’ found in both assembly ‘{1}’ and ‘{2}’. Consider setting the ‘Embed Interop Types’ property to false.
CS1759ErrorCannot embed interop types from assembly ‘{0}’ because it is missing either the ‘{1}’ attribute or the ‘{2}’ attribute.
CS1760ErrorAssemblies ‘{0}’ and ‘{1}’ refer to the same metadata but only one is a linked reference (specified using /link option); consider removing one of the references.
CS1761ErrorEmbedding the interop type ‘{0}’ from assembly ‘{1}’ causes a name clash in the current assembly. Consider setting the ‘Embed Interop Types’ property to false.
CS1762WarningA reference was created to embedded interop assembly ‘{0}’ because of an indirect reference to that assembly created by assembly ‘{1}’. Consider changing the ‘Embed Interop Types’ property on either assembly.
CS1763Error‘{0}’ is of type ‘{1}’. A default parameter value of a reference type other than string can only be initialized with null
CS1764ErrorCannot use fixed local ‘{0}’ inside an anonymous method, lambda expression, or query expression
CS1766ErrorSource interface ‘{0}’ is missing method ‘{1}’ which is required to embed event ‘{2}’.
CS1767ErrorInterface ‘{0}’ has an invalid source interface which is required to embed event ‘{1}’.
CS1768ErrorType ‘{0}’ cannot be embedded because it has a generic argument. Consider setting the ‘Embed Interop Types’ property to false.
CS1769ErrorType ‘{0}’ from assembly ‘{1}’ cannot be used across assembly boundaries because it has a generic type argument that is an embedded interop type.
CS1770ErrorA value of type ‘{0}’ cannot be used as default parameter for nullable parameter ‘{1}’ because ‘{0}’ is not a simple type
CS1773ErrorInvalid version {0} for /subsystemversion. The version must be 6.02 or greater for ARM or AppContainerExe, and 4.00 or greater otherwise
CS1774ErrorEmbedded interop method ‘{0}’ contains a body.
CS1900ErrorWarning level must be zero or greater
CS1902ErrorInvalid option ‘{0}’ for /debug; must be ‘portable’, ‘embedded’, ‘full’ or ‘pdbonly’
CS1906ErrorInvalid option ‘{0}’; Resource visibility must be either ‘public’ or ‘private’
CS1908ErrorThe type of the argument to the DefaultParameterValue attribute must match the parameter type
CS1910ErrorArgument of type ‘{0}’ is not applicable for the DefaultParameterValue attribute
CS1912ErrorDuplicate initialization of member ‘{0}’
CS1913ErrorMember ‘{0}’ cannot be initialized. It is not a field or property.
CS1914ErrorStatic field or property ‘{0}’ cannot be assigned in an object initializer
CS1917ErrorMembers of readonly field ‘{0}’ of type ‘{1}’ cannot be assigned with an object initializer because it is of a value type
CS1918ErrorMembers of property ‘{0}’ of type ‘{1}’ cannot be assigned with an object initializer because it is of a value type
CS1919ErrorUnsafe type ‘{0}’ cannot be used in object creation
CS1920ErrorElement initializer cannot be empty
CS1921ErrorThe best overloaded method match for ‘{0}’ has wrong signature for the initializer element. The initializable Add must be an accessible instance method.
CS1922ErrorCannot initialize type ‘{0}’ with a collection initializer because it does not implement ‘System.Collections.IEnumerable’
CS1926ErrorError opening Win32 manifest file {0} — {1}
CS1927WarningIgnoring /win32manifest for module because it only applies to assemblies
CS1929Error‘{0}’ does not contain a definition for ‘{1}’ and the best extension method overload ‘{2}’ requires a receiver of type ‘{3}’
CS1930ErrorThe range variable ‘{0}’ has already been declared
CS1931ErrorThe range variable ‘{0}’ conflicts with a previous declaration of ‘{0}’
CS1932ErrorCannot assign {0} to a range variable
CS1934ErrorCould not find an implementation of the query pattern for source type ‘{0}’. ‘{1}’ not found. Consider explicitly specifying the type of the range variable ‘{2}’.
CS1935ErrorCould not find an implementation of the query pattern for source type ‘{0}’. ‘{1}’ not found. Are you missing required assembly references or a using directive for ‘System.Linq’?
CS1936ErrorCould not find an implementation of the query pattern for source type ‘{0}’. ‘{1}’ not found.
CS1937ErrorThe name ‘{0}’ is not in scope on the left side of ‘equals’. Consider swapping the expressions on either side of ‘equals’.
CS1938ErrorThe name ‘{0}’ is not in scope on the right side of ‘equals’. Consider swapping the expressions on either side of ‘equals’.
CS1939ErrorCannot pass the range variable ‘{0}’ as an out or ref parameter
CS1940ErrorMultiple implementations of the query pattern were found for source type ‘{0}’. Ambiguous call to ‘{1}’.
CS1941ErrorThe type of one of the expressions in the {0} clause is incorrect. Type inference failed in the call to ‘{1}’.
CS1942ErrorThe type of the expression in the {0} clause is incorrect. Type inference failed in the call to ‘{1}’.
CS1943ErrorAn expression of type ‘{0}’ is not allowed in a subsequent from clause in a query expression with source type ‘{1}’. Type inference failed in the call to ‘{2}’.
CS1944ErrorAn expression tree may not contain an unsafe pointer operation
CS1945ErrorAn expression tree may not contain an anonymous method expression
CS1946ErrorAn anonymous method expression cannot be converted to an expression tree
CS1947ErrorRange variable ‘{0}’ cannot be assigned to — it is read only
CS1948ErrorThe range variable ‘{0}’ cannot have the same name as a method type parameter
CS1949ErrorThe contextual keyword ‘var’ cannot be used in a range variable declaration
CS1950ErrorThe best overloaded Add method ‘{0}’ for the collection initializer has some invalid arguments
CS1951ErrorAn expression tree lambda may not contain a ref, in or out parameter
CS1952ErrorAn expression tree lambda may not contain a method with variable arguments
CS1954ErrorThe best overloaded method match ‘{0}’ for the collection initializer element cannot be used. Collection initializer ‘Add’ methods cannot have ref or out parameters.
CS1955ErrorNon-invocable member ‘{0}’ cannot be used like a method.
CS1956WarningMember ‘{0}’ implements interface member ‘{1}’ in type ‘{2}’. There are multiple matches for the interface member at run-time. It is implementation dependent which method will be called.
CS1957WarningMember ‘{1}’ overrides ‘{0}’. There are multiple override candidates at run-time. It is implementation dependent which method will be called. Please use a newer runtime.
CS1958ErrorObject and collection initializer expressions may not be applied to a delegate creation expression
CS1959Error‘{0}’ is of type ‘{1}’. The type specified in a constant declaration must be sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, decimal, bool, string, an enum-type, or a reference-type.
CS1960ErrorInvalid variance modifier. Only interface and delegate type parameters can be specified as variant.
CS1961ErrorInvalid variance: The type parameter ‘{1}’ must be {3} valid on ‘{0}’. ‘{1}’ is {2}.
CS1962ErrorThe typeof operator cannot be used on the dynamic type
CS1963ErrorAn expression tree may not contain a dynamic operation
CS1964Error‘{0}’: user-defined conversions to or from the dynamic type are not allowed
CS1965Error‘{0}’: cannot derive from the dynamic type
CS1966Error‘{0}’: cannot implement a dynamic interface ‘{1}’
CS1967ErrorConstraint cannot be the dynamic type
CS1968ErrorConstraint cannot be a dynamic type ‘{0}’
CS1969ErrorOne or more types required to compile a dynamic expression cannot be found. Are you missing a reference?
CS1970ErrorDo not use ‘System.Runtime.CompilerServices.DynamicAttribute’. Use the ‘dynamic’ keyword instead.
CS1971ErrorThe call to method ‘{0}’ needs to be dynamically dispatched, but cannot be because it is part of a base access expression. Consider casting the dynamic arguments or eliminating the base access.
CS1972ErrorThe indexer access needs to be dynamically dispatched, but cannot be because it is part of a base access expression. Consider casting the dynamic arguments or eliminating the base access.
CS1973Error‘{0}’ has no applicable method named ‘{1}’ but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.
CS1974WarningThe dynamically dispatched call to method ‘{0}’ may fail at runtime because one or more applicable overloads are conditional methods.
CS1975ErrorThe constructor call needs to be dynamically dispatched, but cannot be because it is part of a constructor initializer. Consider casting the dynamic arguments.
CS1976ErrorCannot use a method group as an argument to a dynamically dispatched operation. Did you intend to invoke the method?
CS1977ErrorCannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type.
CS1978ErrorCannot use an expression of type ‘{0}’ as an argument to a dynamically dispatched operation.
CS1979ErrorQuery expressions over source type ‘dynamic’ or with a join sequence of type ‘dynamic’ are not allowed
CS1980ErrorCannot define a class or member that utilizes ‘dynamic’ because the compiler required type ‘{0}’ cannot be found. Are you missing a reference?
CS1981WarningUsing ‘{0}’ to test compatibility with ‘{1}’ is essentially identical to testing compatibility with ‘{2}’ and will succeed for all non-null values
CS1983ErrorThe return type of an async method must be void, Task, Task\<T\>, a task-like type, IAsyncEnumerable\<T\>, or IAsyncEnumerator\<T\>
CS1984ErrorCannot await in the body of a finally clause
CS1985ErrorCannot await in a catch clause
CS1986Error‘await’ requires that the type {0} have a suitable ‘GetAwaiter’ method
CS1988ErrorAsync methods cannot have ref, in or out parameters
CS1989ErrorAsync lambda expressions cannot be converted to expression trees
CS1991Error‘{0}’ cannot implement ‘{1}’ because ‘{2}’ is a Windows Runtime event and ‘{3}’ is a regular .NET event.
CS1992ErrorThe ‘await’ operator can only be used when contained within a method or lambda expression marked with the ‘async’ modifier
CS1994ErrorThe ‘async’ modifier can only be used in methods that have a body.
CS1995ErrorThe ‘await’ operator may only be used in a query expression within the first collection expression of the initial ‘from’ clause or within the collection expression of a ‘join’ clause
CS1996ErrorCannot await in the body of a lock statement
CS1997ErrorSince ‘{0}’ is an async method that returns ‘Task’, a return keyword must not be followed by an object expression. Did you intend to return ‘Task\<T\>‘?
CS1998WarningThis async method lacks ‘await’ operators and will run synchronously. Consider using the ‘await’ operator to await non-blocking API calls, or ‘await Task.Run(…)’ to do CPU-bound work on a background thread.

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