Following this post: https://blog.bredvid.no/validating-configuration-in-asp-net-core-e9825bd15f10
I m now available to validate the Settings when a service need it.
You can get a list of configured option types by iterating the IServiceCollection
instance:
var configuredOptionTypes =
from descriptor in services
let serviceType = descriptor.ServiceType
where serviceType.IsGenericType
where serviceType.GetGenericTypeDefinition() == typeof(IConfigureNamedOptions<>)
let optionType = serviceType.GetGenericArguments()[0]
select optionType;