18 instantiations of MissingParameterValueException
Aspire.Hosting (4)
ApplicationModel\ParameterResource.cs (1)
517return new MissingParameterValueException($"Parameter resource '{Name}' requires a value.");
Orchestrator\ParameterProcessor.cs (1)
585await parameterResource.SetExceptionAsync(new MissingParameterValueException("Parameter value has been deleted."), cancellationToken).ConfigureAwait(false);
ParameterResourceBuilderExtensions.cs (2)
325?? throw new MissingParameterValueException($"Parameter resource could not be used because configuration key '{configurationKey}' is missing and the Parameter has no default value."); 361throw new MissingParameterValueException($"Connection string parameter resource could not be used because connection string '{name}' is missing."),
Aspire.Hosting.Azure.Tests (2)
AzureDeployerTests.cs (2)
1252var dependentParam = new ParameterResource("dependent-param", p => throw new MissingParameterValueException("Should be prompted"), secret: false); 1297var portParam = new ParameterResource("app-port", p => throw new MissingParameterValueException("Should be prompted"), secret: false);
Aspire.Hosting.OpenAI (1)
OpenAIExtensions.cs (1)
35throw new MissingParameterValueException($"OpenAI API key parameter '{name}-openai-apikey' is missing and OPENAI_API_KEY environment variable is not set.");
Aspire.Hosting.Tests (11)
AddParameterTests.cs (2)
155var parameter = new ParameterResource("optional", _ => throw new MissingParameterValueException("Parameter 'optional' is missing."), secret: false) 176var parameter = new ParameterResource("test", _ => throw new MissingParameterValueException("Parameter 'test' is missing."), secret: false);
Orchestrator\ParameterProcessorTests.cs (9)
170Assert.True(parameter.TrySetException(new MissingParameterValueException("Missing parameter value."))); 893var missingParam = builder.AddParameter("missingParam", () => throw new MissingParameterValueException("Parameter 'missingParam' is missing")); 1766return new ParameterResource(name, _ => configuration[$"Parameters:{name}"] ?? throw new MissingParameterValueException($"Parameter '{name}' is missing"), secret); 1782return new ParameterResource(name, _ => throw new MissingParameterValueException($"Parameter '{name}' is missing"), secret: secret); 1812parameterDefault => configuration["Parameters:generatedParam"] ?? parameterDefault?.GetDefaultValue() ?? throw new MissingParameterValueException("Parameter 'generatedParam' is missing"), 1842_ => throw new MissingParameterValueException("Connection string 'mydb' is missing"), 1883_ => throw new MissingParameterValueException("Parameter 'myparam' is missing"), 1924_ => throw new MissingParameterValueException("Parameter 'customparam' is missing"), 2235configuration[configurationKey] ?? throw new MissingParameterValueException("Parameter is missing."))
35 references to MissingParameterValueException
Aspire.Hosting (14)
ApplicationModel\ParameterResource.cs (8)
49catch (MissingParameterValueException) 142var missingValueException = CreateMissingValueException(value: null)!; 257/// or an empty string are faulted with <see cref="MissingParameterValueException"/>. Use <see cref="SetValueAsync(string?, CancellationToken)"/> 275var missingValueException = CreateMissingValueException(value); 347/// are faulted with <see cref="MissingParameterValueException"/>, while optional parameters can be cleared to <see langword="null"/>. 375var missingValueException = CreateMissingValueException(value); 507return task.Exception is { InnerExceptions: [MissingParameterValueException] }; 510private MissingParameterValueException? CreateMissingValueException(string? value)
MissingParameterValueException.cs (2)
20/// Initializes a new instance of the <see cref="MissingParameterValueException"/> class with a specified error message. 28/// Initializes a new instance of the <see cref="MissingParameterValueException"/> class with a specified error message
Orchestrator\ParameterProcessor.cs (3)
220if (interactionService.IsAvailable && ex is MissingParameterValueException) 238if (ex is MissingParameterValueException && interactionService.IsAvailable) 285if (eventArgs.Exception is MissingParameterValueException)
Publishing\ResourceContainerImageManager.cs (1)
1021catch (MissingParameterValueException)
Aspire.Hosting.Azure.EntraId.Tests (1)
EntraIdInitializationTests.cs (1)
194$"Failed to get the value of the tenant ID parameter 'EntraTenantId'.\n{typeof(MissingParameterValueException).FullName}: ",
Aspire.Hosting.Kubernetes (3)
KubernetesEnvironmentResource.cs (3)
604catch (MissingParameterValueException) 633catch (MissingParameterValueException) 670catch (MissingParameterValueException)
Aspire.Hosting.Radius (2)
Publishing\RadiusInfrastructureBuilder.cs (2)
2854catch (MissingParameterValueException) 4391ex is MissingParameterValueException ||
Aspire.Hosting.Tests (15)
AddParameterTests.cs (5)
102await Assert.ThrowsAsync<MissingParameterValueException>( 130await Assert.ThrowsAsync<MissingParameterValueException>( 223await Assert.ThrowsAsync<MissingParameterValueException>(() => parameter.GetValueAsync(CancellationToken.None).AsTask()).DefaultTimeout(); 237await Assert.ThrowsAsync<MissingParameterValueException>(() => parameter.GetValueAsync(CancellationToken.None).AsTask()).DefaultTimeout(); 1146await Assert.ThrowsAsync<MissingParameterValueException>(async () =>
Orchestrator\ParameterProcessorTests.cs (6)
216Assert.IsType<MissingParameterValueException>(parameterWithMissingValue.WaitForValueTcs.Task.Exception?.InnerException); 2123await Assert.ThrowsAsync<MissingParameterValueException>(() => parameter.GetValueAsync(CancellationToken.None).AsTask()).DefaultTimeout(); 2187await Assert.ThrowsAsync<MissingParameterValueException>(() => parameter.GetValueAsync(CancellationToken.None).AsTask()).DefaultTimeout(); 2367await Assert.ThrowsAsync<MissingParameterValueException>( 2418await Assert.ThrowsAsync<MissingParameterValueException>(() => parameter.GetValueAsync(CancellationToken.None).AsTask()).DefaultTimeout(); 2454await Assert.ThrowsAsync<MissingParameterValueException>(() => parameter.GetValueAsync(CancellationToken.None).AsTask()).DefaultTimeout();
WithEnvironmentTests.cs (2)
333var innerException = Assert.IsType<MissingParameterValueException>(exception.InnerException);
WithReferenceTests.cs (2)
612var inner = Assert.IsType<MissingParameterValueException>(aggregate.InnerException);