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.
In .NET 6.0, we've introduced the
RequiresPreviewFeaturesAttributethat 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.