-
With .NET 8, there is now the new way to read in configuration source data (data from config files or env vars, keyvault, etc) => using a new IOptionsValidator class. This is great because the options validation source generator can produce optimized validation code at compile time. But the actual values are checked at run time when the IOptions instance is first 'required' .. and not during the OnStartup. which means, if a piece of code which requires some IOptions isn't 'called' for a while, then we don't know the configuration data is "bad". Are there any plans to extend this to optionally wire this up to OnStartup? I noticed that there is an IStartUpValidator interface already. Or maybe this exists and the documentation is lacking/missing mentioning this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Did you see AddOptionsWithValidateOnStart? Relevant issue for this: #89263 |
Beta Was this translation helpful? Give feedback.
Did you see AddOptionsWithValidateOnStart?
Relevant issue for this: #89263