ExperimentalAttribute.DiagnosticId Property

Definition

Gets the ID that the compiler will use when reporting a use of the API the attribute applies to.

C#
public string DiagnosticId { get; }

Property Value

The unique diagnostic ID.

Remarks

The diagnostic ID is shown in build output for warnings and errors.

This property represents the unique ID that can be used to suppress the warnings or errors, if needed.

Choose an appropriate diagnostic ID such that it is unique.

Applies to

Product Versions
.NET 8, 9