Programming Search⌘K

C# errors and diagnostics, page 7 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.

foreach statement cannot operate on variables of type '…' because '…' does not contain a public instance or extension definition for '…'. Did you mean 'await foreach' rather than 'foreach'?. CS8414

Code
CS8414
Severity
error
Message
foreach statement cannot operate on variables of type '{}' because '{}' does not contain a public instance or extension definition for '{}'. Did you mean 'await foreach' rather than 'foreach'?

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

Asynchronous foreach statement cannot operate on variables of type '…' because '…' does not contain a public instance or extension definition for '…'. Did you mean 'foreach' rather than 'await foreach'?. CS8415

Code
CS8415
Severity
error
Message
Asynchronous foreach statement cannot operate on variables of type '{}' because '{}' does not contain a public instance or extension definition for '{}'. Did you mean 'foreach' rather than 'await foreach'?

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

The EnumeratorCancellationAttribute will have no effect. The attribute is only effective on a parameter of type CancellationToken in an async-iterator method returning IAsyncEnumerable. CS8424

Code
CS8424
Severity
warning
Message
The EnumeratorCancellationAttribute applied to parameter '{}' will have no effect. The attribute is only effective on a parameter of type CancellationToken in an async-iterator method returning IAsyncEnumerable

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

Async-iterator member has one or more parameters of type 'CancellationToken' but none of them is decorated with the 'EnumeratorCancellation' attribute, so the cancellation token parameter from the generated 'IAsyncEnumerable<>.GetAsyncEnumerator' will be unconsumed. CS8425

Code
CS8425
Severity
warning
Message
Async-iterator '{}' has one or more parameters of type 'CancellationToken' but none of them is decorated with the 'EnumeratorCancellation' attribute, so the cancellation token parameter from the generated 'IAsyncEnumerable<>.GetAsyncEnumerator' will be unconsumed

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

A nullable type parameter must be known to be a value type or non-nullable reference type unless language version '…' or greater is used. Consider changing the language version or adding a 'class', 'struct', or type constraint. CS8627

Code
CS8627
Severity
error
Message
A nullable type parameter must be known to be a value type or non-nullable reference type unless language version '{}' or greater is used. Consider changing the language version or adding a 'class', 'struct', or type constraint.

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

Method '…' specifies a 'struct' constraint for type parameter '…', but corresponding type parameter '…' of overridden or explicitly implemented method '…' is not a non-nullable value type. CS8666

Code
CS8666
Severity
error
Message
Method '{}' specifies a 'struct' constraint for type parameter '{}', but corresponding type parameter '{}' of overridden or explicitly implemented method '{}' is not a non-nullable value type.

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