Programming Search⌘K

C# errors and diagnostics, page 5 of 11

The error codes and warnings of C#, with the message that each one prints and what causes it. This page has 2,008 cards.

'…' is of type '…'. 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. CS1959

Code
CS1959
Severity
error
Message
'{}' is of type '{}'. 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.

Source: github.com. JSON record. This entry is a card. Help write this page.

The call to method '…' 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. CS1971

Code
CS1971
Severity
error
Message
The call to method '{}' 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.

Source: github.com. JSON record. This entry is a card. Help write this page.

'…' has no applicable method named '…' 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. CS1973

Code
CS1973
Severity
error
Message
'{}' has no applicable method named '{}' 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.

Source: github.com. JSON record. This entry is a card. Help write this page.

'await' requires that the return type '…' of '….GetAwaiter()' have suitable 'IsCompleted', 'OnCompleted', and 'GetResult' members, and implement 'INotifyCompletion' or 'ICriticalNotifyCompletion'. CS4011

Code
CS4011
Severity
error
Message
'await' requires that the return type '{}' of '{}.GetAwaiter()' have suitable 'IsCompleted', 'OnCompleted', and 'GetResult' members, and implement 'INotifyCompletion' or 'ICriticalNotifyCompletion'

Source: github.com. JSON record. This entry is a card. Help write this page.