OptionsValidationException
The .NET exception thrown when options fail validation, naming the options class, the failing member and the error.
In more detail
Its message lists each failure, so a bad setting can be fixed without a debugger. With ValidateOnStart it appears at startup and the process exits before serving anything.
Related terms
- ValidateOnStart — The options-builder call that makes the host validate options while starting and refuse to start if they are invalid.
- options pattern — Binding a configuration section to a plain class with typed properties, validating it, and injecting it into services instead of reading raw strings.
Taught in
- The Options Pattern: Strongly Typed Configuration — Modern .NET Core, C# & Enterprise Microservices