Programming Search⌘K

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

Collection expression may incur unexpected heap allocations due to use of '..' spreads. Consider explicitly creating an array, then converting to the final type to make the allocation explicit. CS9209

Code
CS9209
Severity
warning
Message
Collection expression of type '{}' may incur unexpected heap allocations due to the use of '..' spreads. Consider explicitly creating an array, then converting to '{}' to make the allocation explicit.

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

Compiling requires binding the lambda expression many times. Consider declaring the lambda expression with explicit parameter types, or if the containing method call is generic, consider using explicit type arguments. CS9236

Code
CS9236
Severity
info
Message
Compiling requires binding the lambda expression at least {} times. Consider declaring the lambda expression with explicit parameter types, or if the containing method call is generic, consider using explicit type arguments.

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

Non-nullable property must contain a non-null value when exiting constructor. Consider adding the 'required' modifier, or declaring the property as nullable, or safely handling the case where 'field' is null in the 'get' accessor. CS9264

Code
CS9264
Severity
warning
Message
Non-nullable {} '{}' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier, or declaring the {} as nullable, or safely handling the case where 'field' is null in the 'get' accessor.

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

'InterceptsLocationAttribute(string, int, int)' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. (https://github.com/dotnet/roslyn/issues/72133). CS9270

Code
CS9270
Severity
warning
Message
'InterceptsLocationAttribute(string, int, int)' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. (https://github.com/dotnet/roslyn/issues/72133)

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

The type 'Microsoft.CodeAnalysis.EmbeddedAttribute' must be non-generic, internal, non-file, sealed, non-static, have a parameterless constructor, inherit from System.Attribute, and be able to be applied to any type. CS9271

Code
CS9271
Severity
error
Message
The type 'Microsoft.CodeAnalysis.EmbeddedAttribute' must be non-generic, internal, non-file, sealed, non-static, have a parameterless constructor, inherit from System.Attribute, and be able to be applied to any type.

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

Method '…' uses a feature that is not supported by runtime async. Opt the method out of runtime async by attributing it with 'System.Runtime.CompilerServices.RuntimeAsyncMethodGenerationAttribute(false)'. CS9328

Code
CS9328
Severity
error
Message
Method '{}' uses a feature that is not supported by runtime async. Opt the method out of runtime async by attributing it with 'System.Runtime.CompilerServices.RuntimeAsyncMethodGenerationAttribute(false)'.

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

'…' does not contain a definition for '…' and no accessible extension method '…' accepting a first argument of type '…' could be found (did you mean to iterate over the async collection with 'await foreach' instead?). CS9353

Code
CS9353
Severity
error
Message
'{}' does not contain a definition for '{}' and no accessible extension method '{}' accepting a first argument of type '{}' could be found (did you mean to iterate over the async collection with 'await foreach' instead?)

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