SYSLIB diagnostics for options validation source generation
The following table shows the diagnostic IDs for options validation source-generation analyzers in .NET 8 and later versions.
Diagnostic ID | Description |
---|---|
SYSLIB1201 |
Can't use ValidateObjectMembersAttribute or ValidateEnumeratedItemsAttribute on fields or properties with open generic types. |
SYSLIB1202 |
A member type has no fields or properties to validate. |
SYSLIB1203 |
A type has no fields or properties to validate. |
SYSLIB1204 |
A type annotated with OptionsValidatorAttribute doesn't implement the necessary interface. |
SYSLIB1205 |
A type already includes an implementation of the 'Validate' method. |
SYSLIB1206 |
Can't validate private fields or properties. |
SYSLIB1207 |
Member type is not enumerable. |
SYSLIB1208 |
Validators used for transitive or enumerable validation must have a constructor with no parameters. |
SYSLIB1209 |
OptionsValidatorAttribute can't be applied to a static class. |
SYSLIB1210 |
Null validator type specified for the ValidateObjectMembersAttribute or ValidateEnumeratedItemsAttribute attributes. |
SYSLIB1211 |
Unsupported circular references in model types. |
SYSLIB1212 |
Member potentially missing transitive validation. |
SYSLIB1213 |
Member potentially missing enumerable validation. |
SYSLIB1214 |
Can't validate constants, static fields or properties. |
SYSLIB1215 |
Validation attribute on the member is inaccessible from the validator type. |
SYSLIB1216 |
C# language version not supported by the options validation source generator. |
SYSLIB1217 |
The validation attribute is only applicable to properties of type string, array, or ICollection ; it cannot be used with other types. |
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for