89 references to DistributedApplicationException
Aspire.Hosting (53)
ApplicationModel\ConnectionStringReference.cs (1)
36internal void ThrowConnectionStringUnavailableException() => throw new DistributedApplicationException($"The connection string for the resource '{Resource.Name}' is not available.");
ApplicationModel\ResourceNotificationService.cs (8)
173throw new DistributedApplicationException($"Dependency resource '{displayName}' failed to start."); 185throw new DistributedApplicationException( 217_ => throw new DistributedApplicationException($"Unexpected wait behavior: {waitBehavior}") 282throw new DistributedApplicationException($"Stopped waiting for resource '{resourceName}' to become healthy because it failed to start."); 299_ => throw new DistributedApplicationException($"Unexpected wait behavior: {waitBehavior}") 333throw new DistributedApplicationException($"Dependency resource '{displayName}' failed to start."); 345throw new DistributedApplicationException( 385_ => throw new DistributedApplicationException($"Unexpected wait type: {waitAnnotation.WaitType}")
Dashboard\DashboardLifecycleHook.cs (1)
102throw new DistributedApplicationException("Dashboard path empty or file does not exist.");
Dcp\DcpDependencyCheck.cs (5)
86throw new DistributedApplicationException(string.Format( 114throw new DistributedApplicationException(string.Format( 163throw new DistributedApplicationException(string.Format( 227throw new DistributedApplicationException($"Container runtime '{containerRuntime}' could not be found. See https://aka.ms/dotnet/aspire/containers for more details on supported container runtimes."); 254throw new DistributedApplicationException(messageFormat.Replace("{Runtime}", containerRuntime).ToString());
Devcontainers\Codespaces\CodespacesOptions.cs (1)
51return configuration.GetValue<string>(key) ?? throw new DistributedApplicationException($"Codespaces was detected but {key} environment missing.");
Devcontainers\DevcontainerSettingsWriter.cs (2)
63throw new DistributedApplicationException($"Failed to acquire semaphore for settings file: {settingsPath}"); 154throw new DistributedApplicationException("Codespaces or Devcontainer not detected.");
DistributedApplicationBuilder.cs (4)
126_ => throw new DistributedApplicationException("Invalid operation specified. Valid operations are 'publish', 'inspect', or 'run'.") 134_ => throw new DistributedApplicationException("Invalid operation specified. Valid operations are 'publish', 'inspect', or 'run'.") 482throw new DistributedApplicationException($"Multiple resources with the name '{duplicateResourceName}'. Resource names are case-insensitive."); 505throw new DistributedApplicationException($"Cannot add resource of type '{resource.GetType()}' with name '{resource.Name}' because resource of type '{existingResource.GetType()}' with that name already exists. Resource names are case-insensitive.");
Exceptions.cs (1)
9public FailedToApplyEnvironmentException(string message) : base(message) { }
ParameterResourceBuilderExtensions.cs (2)
155?? throw new DistributedApplicationException($"Parameter resource could not be used because configuration key '{configurationKey}' is missing and the Parameter has no default value."); ; 192throw new DistributedApplicationException($"Connection string parameter resource could not be used because connection string '{name}' is missing."),
Publishing\DockerContainerRuntime.cs (2)
34throw new DistributedApplicationException("Failed to start Docker CLI."); 74throw new DistributedApplicationException($"Docker build failed with exit code {result.ExitCode}.");
Publishing\ManifestPublisher.cs (2)
30throw new DistributedApplicationException( 63var manifestPath = _options.Value.OutputPath ?? throw new DistributedApplicationException("The '--output-path [path]' option was not specified even though '--publisher manifest' argument was used.");
Publishing\ManifestPublishingContext.cs (3)
63var manifestDirectory = Path.GetDirectoryName(fullyQualifiedManifestPath) ?? throw new DistributedApplicationException("Could not get directory name of output path"); 153throw new DistributedApplicationException("Project metadata not found."); 266throw new DistributedApplicationException("Could not get container image name.");
Publishing\PodmanContainerRuntime.cs (2)
34throw new DistributedApplicationException("Failed to start Podman CLI."); 74throw new DistributedApplicationException($"Docker build failed with exit code {result.ExitCode}.");
Publishing\ResourceContainerImageBuilder.cs (3)
86throw new DistributedApplicationException($"The resource '{projectMetadata}' does not have a project metadata annotation."); 112throw new DistributedApplicationException("Failed to start .NET CLI."); 137throw new DistributedApplicationException($"Failed to build container image, stdout: {stdout}, stderr: {stderr}");
ResourceBuilderExtensions.cs (13)
569throw new DistributedApplicationException($"Endpoint with name '{annotation.Name}' already exists. Endpoint name may not have been explicitly specified and was derived automatically from scheme argument (e.g. 'http', 'https', or 'tcp'). Multiple calls to WithEndpoint (and related methods) may result in a conflict if name argument is not specified. Each endpoint must have a unique name. For more information on networking in .NET Aspire see: https://aka.ms/dotnet/aspire/networking"); 1051throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself."); 1056throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'."); 1147throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself."); 1152throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'."); 1203throw new DistributedApplicationException($"Resource '{builder.Resource.Name}' already has a health check with key '{key}'."); 1264throw new DistributedApplicationException($"The endpoint '{endpointName}' does not exist on the resource '{builder.Resource.Name}'."); 1269throw new DistributedApplicationException($"The endpoint '{endpointName}' on resource '{builder.Resource.Name}' was not using the '{desiredScheme}' scheme."); 1295throw new DistributedApplicationException($"The URI for the health check is not set. Ensure that the resource has been allocated before the health check is executed."); 1612?? throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as the endpoint selector returned null."); 1719throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as the endpoint with name '{matchingEndpoint.EndpointName}' and scheme '{matchingEndpoint.Scheme}' is not an HTTP endpoint."); 1727throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as no endpoint was found matching one of the specified names: {endpointNamesString}"); 1747throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as it has no HTTP endpoints.");
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (3)
18throw new DistributedApplicationException(Resources.ProjectDoesNotContainMetadataExceptionMessage); 60throw new DistributedApplicationException(message); 77throw new DistributedApplicationException(message);
Aspire.Hosting.Azure (2)
Exceptions.cs (2)
9public AzureCliNotOnPathException(string message) : base(message) { } 16public FailedToApplyEnvironmentException(string message) : base(message) { }
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBExtensions.cs (1)
98throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{builder.Resource.Name}' resource but the connection string was null.");
Aspire.Hosting.Azure.EventHubs (3)
AzureEventHubsExtensions.cs (3)
271?? throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{builder.Resource.Name}' resource but the connection string was null."); 283throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource does not have any Event Hubs."); 289sp => client ?? throw new DistributedApplicationException("EventHubProducerClient is not initialized"),
Aspire.Hosting.Azure.Functions (3)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (3)
18throw new DistributedApplicationException(Resources.ProjectDoesNotContainMetadataExceptionMessage); 60throw new DistributedApplicationException(message); 77throw new DistributedApplicationException(message);
Aspire.Hosting.Azure.ServiceBus (2)
AzureServiceBusExtensions.cs (2)
487throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{builder.Resource.Name}' resource but the connection string was null."); 510() => serviceBusClient ?? throw new DistributedApplicationException($"{nameof(serviceBusClient)} was not initialized."),
Aspire.Hosting.Azure.Storage (1)
AzureStorageExtensions.cs (1)
132throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{builder.Resource.Name}' resource but the connection string was null.");
Aspire.Hosting.Docker (1)
DockerComposePublisher.cs (1)
47throw new DistributedApplicationException(
Aspire.Hosting.Elasticsearch (1)
ElasticsearchBuilderExtensions.cs (1)
65throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{elasticsearch.Name}' resource but the connection string was null.");
Aspire.Hosting.Garnet (1)
GarnetBuilderExtensions.cs (1)
118throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{garnet.Name}' resource but the connection string was null.");
Aspire.Hosting.Kafka (1)
KafkaBuilderExtensions.cs (1)
47throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{kafka.Name}' resource but the connection string was null.");
Aspire.Hosting.Kubernetes (1)
KubernetesPublisher.cs (1)
65throw new DistributedApplicationException(
Aspire.Hosting.MongoDB (2)
MongoDBBuilderExtensions.cs (2)
68throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{mongoDBContainer.Name}' resource but the connection string was null."); 119throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{mongoDBDatabase.Name}' resource but the connection string was null.");
Aspire.Hosting.MySql (1)
MySqlBuilderExtensions.cs (1)
47throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{resource.Name}' resource but the connection string was null.");
Aspire.Hosting.Nats (1)
NatsBuilderExtensions.cs (1)
63?? throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{nats.Name}' resource but the connection string was null.");
Aspire.Hosting.Oracle (1)
OracleDatabaseBuilderExtensions.cs (1)
49throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{oracleDatabaseServer.Name}' resource but the connection string was null.");
Aspire.Hosting.PostgreSQL (3)
PostgresBuilderExtensions.cs (3)
62throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{postgresServer.Name}' resource but the connection string was null."); 70throw new DistributedApplicationException($"ResourceReadyEvent was published for the '{postgresServer.Name}' resource but the connection string was null."); 158throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{name}' resource but the connection string was null.");
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
55?? throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{qdrant.Name}' resource but the connection string was null.");
Aspire.Hosting.RabbitMQ (2)
RabbitMQBuilderExtensions.cs (2)
51throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{rabbitMq.Name}' resource but the connection string was null."); 204throw new DistributedApplicationException($"Cannot configure the RabbitMQ resource '{builder.Resource.Name}' to enable the management plugin as it uses an unrecognized container image registry, name, or tag.");
Aspire.Hosting.Redis (1)
RedisBuilderExtensions.cs (1)
80throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{redis.Name}' resource but the connection string was null.");
Aspire.Hosting.SqlServer (3)
SqlServerBuilderExtensions.cs (3)
54throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{sqlServer.Name}' resource but the connection string was null."); 62throw new DistributedApplicationException($"ResourceReadyEvent was published for the '{sqlServer.Name}' resource but the connection string was null."); 121throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{name}' resource but the connection string was null.");
Aspire.Hosting.Tests (3)
DistributedApplicationTests.cs (3)
57throw new DistributedApplicationException(exceptionMessage); 98throw new DistributedApplicationException(exceptionMessage); 287throw new DistributedApplicationException(exceptionMessage);
Aspire.Hosting.Valkey (1)
ValkeyBuilderExtensions.cs (1)
130throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{valkey.Name}' resource but the connection string was null.");