Open sandboxFocus

Property AllowExtensionBlockMembers

AllowExtensionBlockMembers

Gets or sets a value indicating whether C# 14 extension block members are allowed.

Declaration
public bool AllowExtensionBlockMembers { get; set; }
Property Value
Type Description
bool
Remarks

You can use this property to override AllowExtensionBlockMembers.

By default, an attribute multicast from an outer declaration, such as the declaring type, is not applied to the static methods that implement the members of C# 14 extension blocks. Set this property to true to include them. An attribute applied directly to an extension block member is applied regardless of this property. The compiler-generated metadata types of extension blocks are never targeted. Classic extension methods are not affected.

See Also