What problem does it solve?
This Skill helps you avoid misconfiguration and fragile “stringly-typed” setup by showing how to structure .NET configuration using strongly-typed options with validation and correct layering.
Core Features & Use Cases
- Options pattern with validation: Bind configuration sections to validated option classes using data annotations and fail fast at startup with ValidateOnStart.
- Correct configuration source layering: Apply appsettings.json, environment-specific appsettings, environment variables, and user secrets in the right override order.
- Secure secrets handling: Keep secrets out of source control by using user secrets in development and Azure Key Vault or environment variables in production.
- Choosing the right options lifetime: Use IOptions for immutable startup values, IOptionsSnapshot for scoped reload scenarios, and IOptionsMonitor for actively changing values.
Quick Start
Load the configuration skill and ask for an example of binding a section from appsettings to a validated Options class, then wiring it into a service using IOptions<T> or IOptionsSnapshot<T> as appropriate for your environment.