Skip to content

Obsolete attribute is ignored for Blazor component parameters #32206

@stsrki

Description

@stsrki

I'm changing some of the APIs in my Blazor component library and I'm trying to add an Obsolete attribute to some of the component parameters. The expected behavior was to have an error if the marked parameter was used but the build output shows no error or warning whatsoever.

Example of marked parameter:

[Obsolete( "The Color parameter will be removed. Please use TextColor instead!", true )]
[Parameter]
public TextColor Color
{
    get => TextColor;
    set => TextColor = value;
}

Usage:

<Paragraph Color="TextColor.Black50">
    Some text.
</Paragraph>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions