Maarten Balliauw 11/8/2023

Provide opt-in to experimental APIs using C#12 ExperimentalAttribute

Read Original

This article details the introduction of the ExperimentalAttribute in C#12, which allows library and framework developers to explicitly mark APIs as experimental and subject to change. It explains how applying the attribute causes build errors for consumers, forcing them to explicitly opt-in via project file configuration or pragma directives, similar to mechanisms in other languages like Kotlin. The post includes code examples and discusses best practices like providing a URL for more information.

Provide opt-in to experimental APIs using C#12 ExperimentalAttribute

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

1
The Beautiful Web
Jens Oliver Meiert 2 votes
2
Container queries are rad AF!
Chris Ferdinandi 2 votes
3
Wagon’s algorithm in Python
John D. Cook 1 votes
5
Top picks — 2026 January
Paweł Grzybek 1 votes
6
In Praise of –dry-run
Henrik Warne 1 votes
8
Vibe coding your first iOS app
William Denniss 1 votes