2 instantiations of OptionsValidationException
Microsoft.Extensions.Options (1)
OptionsFactory.cs (1)
87throw new OptionsValidationException(name, typeof(TOptions), failures);
Microsoft.Extensions.Options.Contextual (1)
Internal\ContextualOptionsFactory.cs (1)
146throw new OptionsValidationException(name, typeof(TOptions), failures);
25 references to OptionsValidationException
Aspire.Hosting.Tests (2)
HealthCheckTests.cs (2)
117var ex = await Assert.ThrowsAsync<OptionsValidationException>(async () =>
Microsoft.AspNetCore.Authentication.Test (1)
CookieTests.cs (1)
293Assert.Throws<OptionsValidationException>(() => options.Get(CookieAuthenticationDefaults.AuthenticationScheme));
Microsoft.AspNetCore.HeaderParsing.Tests (2)
HeaderParsingExtensionsTests.cs (2)
37Assert.Throws<OptionsValidationException>(() => services.GetRequiredService<IOptions<HeaderParsingOptions>>().Value); 47Assert.Throws<OptionsValidationException>(() => services.GetRequiredService<IOptions<HeaderParsingOptions>>().Value);
Microsoft.AspNetCore.HttpOverrides.Tests (2)
CertificateForwardingTest.cs (2)
24Assert.Throws<OptionsValidationException>(() => options.Value); 34Assert.Throws<OptionsValidationException>(() => options.Value);
Microsoft.Extensions.Diagnostics.Probes.Tests (2)
KubernetesProbesOptionsValidatorTests.cs (2)
86catch (OptionsValidationException ex) 115Assert.Throws<OptionsValidationException>(action);
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Logging\HttpClientLoggingExtensionsTest.cs (2)
216await act.Should().ThrowAsync<OptionsValidationException>(); 328await act.Should().ThrowAsync<OptionsValidationException>();
Microsoft.Extensions.Http.Resilience.Tests (4)
Hedging\StandardHedgingTests.cs (2)
49Assert.Throws<OptionsValidationException>(CreateClientWithHandler); 57Assert.Throws<OptionsValidationException>(CreateClientWithHandler);
Resilience\HttpClientBuilderExtensionsTests.Standard.cs (1)
197Assert.Throws<OptionsValidationException>(() => GetPipeline(builder.Services, "test-standard"));
Routing\RoutingStrategyTest.cs (1)
85Assert.Throws<OptionsValidationException>(() => CreateStrategy());
Microsoft.Extensions.Options (7)
IStartupValidator.cs (1)
17/// <exception cref="OptionsValidationException">One or more <see cref="IValidateOptions{TOptions}"/> return failed <see cref="ValidateOptionsResult"/> when validating.</exception>
OptionsFactory.cs (1)
53/// <exception cref="OptionsValidationException">One or more <see cref="IValidateOptions{TOptions}"/> return failed <see cref="ValidateOptionsResult"/> when validating the <typeparamref name="TOptions"/> instance created.</exception>
OptionsManager.cs (1)
40/// <exception cref="OptionsValidationException">One or more <see cref="IValidateOptions{TOptions}"/> return failed <see cref="ValidateOptionsResult"/> when validating the <typeparamref name="TOptions"/> instance created.</exception>
OptionsMonitor.cs (2)
75/// <exception cref="OptionsValidationException">One or more <see cref="IValidateOptions{TOptions}"/> return failed <see cref="ValidateOptionsResult"/> when validating the <typeparamref name="TOptions"/> instance created.</exception> 87/// <exception cref="OptionsValidationException">One or more <see cref="IValidateOptions{TOptions}"/> return failed <see cref="ValidateOptionsResult"/> when validating the <typeparamref name="TOptions"/> instance created.</exception>
OptionsValidationException.cs (1)
15/// Creates a new instance of <see cref="OptionsValidationException"/>.
ValidateOnStart.cs (1)
31catch (OptionsValidationException ex)
Microsoft.Extensions.Options.Contextual.Tests (3)
ContextualOptionsFactoryTests.cs (3)
43await Assert.ThrowsAsync<OptionsValidationException>(async () => await sut.CreateAsync(string.Empty, Mock.Of<IOptionsContext>(), default)); 44await Assert.ThrowsAsync<OptionsValidationException>(async () => await sut.CreateAsync("A Name", Mock.Of<IOptionsContext>(), default)); 56await Assert.ThrowsAsync<OptionsValidationException>(async () => await sut.CreateAsync("Foo", Mock.Of<IOptionsContext>(), default));