You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently alpha APIs are decorated with the ObsoleteAttribute which causes the compiler to generate a warning/error when used. While the generated message is not entirely accurate, it does ensure users see and understand the risks of using a potentially unstable API.
.NET 6 introduced a new attribute, RequiresPreviewFeaturesAttribute, which serves a purpose similar to our use of ObsoleteAttribute. This generates a similar message (but from the Rosyln analyzer rather than the compiler itself), and requires a slightly different method to disable (via MSBuild property). The main disadvantage is disabling applies to all uses of such decorated APIs, rather than individual uses.
Still, RequiresPreviewFeaturesAttribute feels like a more appropriate way to indicate alpha APIs.
Another option is to create our own attribute and set of Roslyn analyzers that have our specific desired semantics; this could then be a start to additional work to help ensure best practices when using the SDK.
Update: .NET 8 introduces ExperimentalAttribute, which is even more closely aligned with our use case.