Skip to content

ApiCompat should verify that [assembly:RequiresPreviewFeaturesAttribute] is not added to an assembly #7940

@jeffhandley

Description

@jeffhandley
  • This issue is blocking
  • This issue is causing unreasonable pain

In .NET 6.0, we've introduced the RequiresPreviewFeaturesAttribute that allows an API or assembly to be annotated as requiring an opt-in for using preview features. Per the feature spec, consumers of those APIs/assemblies will receive build errors unless the opt-in is in place.

PR dotnet/aspnetcore#36783 revealed that a misunderstanding of this feature could lead to us inadvertently marking an already-stable assembly as requiring preview features, assembly-wide. With the analyzer enabled as error-by-default now, we will already have a safeguard by way of consumers getting build errors, but we should add another safeguard in the ApiCompat validation, ensuring that this attribute is not added to an assembly that didn't have it before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Infrastructure-librariesArea maintained by .NET libraries team: APICompat, AsmDiff, GenAPI, GenFacades, PkgProj, etchelp wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions