120 references to DistributedApplicationException
Aspire.Hosting (69)
ApplicationModel\ConnectionStringReference.cs (1)
41internal void ThrowConnectionStringUnavailableException() => throw new DistributedApplicationException($"The connection string for the resource '{Resource.Name}' is not available.");
ApplicationModel\ResourceNotificationService.cs (8)
234throw new DistributedApplicationException($"Stopped waiting for resource '{resourceName}' to become healthy because it failed to start."); 262_ => throw new DistributedApplicationException($"Unexpected wait behavior: {waitBehavior}") 300throw new DistributedApplicationException($"Dependency resource '{displayName}' failed to start."); 312throw new DistributedApplicationException( 361throw new DistributedApplicationException($"Dependency resource '{displayName}' failed to start."); 373throw new DistributedApplicationException( 391_ => throw new DistributedApplicationException($"Unexpected wait behavior: {waitBehavior}") 435_ => throw new DistributedApplicationException($"Unexpected wait type: {waitAnnotation.WaitType}")
Dashboard\DashboardEventHandlers.cs (3)
151throw new DistributedApplicationException($"Failed to parse AppHost runtime config: {runtimeConfigPath}"); 243throw new DistributedApplicationException($"Failed to parse dashboard runtime config: {originalRuntimeConfig}"); 283throw new DistributedApplicationException("Dashboard path empty or file does not exist.");
Dcp\DcpDependencyCheck.cs (5)
88throw new DistributedApplicationException(string.Format( 116throw new DistributedApplicationException(string.Format( 166throw new DistributedApplicationException(string.Format( 253throw new DistributedApplicationException($"Container runtime '{containerRuntime}' could not be found. See https://aka.ms/dotnet/aspire/containers for more details on supported container runtimes."); 272throw new DistributedApplicationException(message);
Dcp\DcpExecutor.cs (3)
1982throw new DistributedApplicationException($"Couldn't find required {nameof(DcpInstancesAnnotation)} annotation on resource {resource.Name}."); 1993throw new DistributedApplicationException($"Couldn't find required instance ID for index {instanceIndex} on resource {resource.Name}."); 2648throw new DistributedApplicationException($"Failed to delete '{resourceName}' successfully before restart.");
Devcontainers\Codespaces\CodespacesOptions.cs (1)
51return configuration.GetValue<string>(key) ?? throw new DistributedApplicationException($"Codespaces was detected but {key} environment missing.");
Devcontainers\DevcontainerSettingsWriter.cs (2)
114throw new DistributedApplicationException($"Failed to acquire semaphore for settings file: {settingsPath}"); 239throw new DistributedApplicationException("Codespaces, Devcontainer, or SSH Remote not detected.");
DistributedApplicationBuilder.cs (4)
146_ => throw new DistributedApplicationException("Invalid operation specified. Valid operations are 'publish' or 'run'.") 153_ => throw new DistributedApplicationException("Invalid operation specified. Valid operations are 'publish' or 'run'.") 751throw new DistributedApplicationException($"Multiple resources with the name '{duplicateResourceName}'. Resource names are case-insensitive."); 774throw 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.");
DotnetToolResourceExtensions.cs (1)
209throw new DistributedApplicationException($"DotnetToolResource requires dotnet SDK 10 or higher to run. Detected version: {version} for working directory {workingDirectory}");
Exceptions.cs (1)
9public FailedToApplyEnvironmentException(string message) : base(message) { }
McpServerResourceBuilderExtensions.cs (2)
60throw new DistributedApplicationException( 77throw new DistributedApplicationException(
MissingParameterValueException.cs (1)
23public MissingParameterValueException(string message) : base(message)
ProjectResourceBuilderExtensions.cs (2)
388throw new DistributedApplicationException(message); 400throw new DistributedApplicationException($"File-based apps are only supported on .NET 10 or later. The version active in '{Path.GetDirectoryName(projectPath)}' {versionValue}.");
Publishing\ContainerRuntimeBase.cs (2)
125throw new DistributedApplicationException($"{Name} login failed with exit code {processResult.ExitCode}."); 164throw new DistributedApplicationException(string.Format(System.Globalization.CultureInfo.InvariantCulture, exceptionMessageTemplate, processResult.ExitCode));
Publishing\DockerContainerRuntime.cs (1)
165throw new DistributedApplicationException($"Docker build failed with exit code {exitCode}.");
Publishing\ManifestPublisher.cs (2)
33throw new DistributedApplicationException( 66var 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)
69var manifestDirectory = Path.GetDirectoryName(fullyQualifiedManifestPath) ?? throw new DistributedApplicationException("Could not get directory name of output path"); 177throw new DistributedApplicationException("Project metadata not found."); 327throw new DistributedApplicationException("Could not get container image name.");
Publishing\ManifestPublishingExtensions.cs (1)
39throw new DistributedApplicationException(
Publishing\PodmanContainerRuntime.cs (1)
96throw new DistributedApplicationException($"Podman build failed with exit code {exitCode}.");
Publishing\ResourceContainerImageManager.cs (2)
309throw new DistributedApplicationException($"Failed to build container image."); 327throw new DistributedApplicationException($"The resource '{projectMetadata}' does not have a project metadata annotation.");
ResourceBuilderExtensions.cs (20)
207throw new DistributedApplicationException($"The URL parameter '{externalService.Resource.UrlParameter.Name}' for the external service '{externalService.Resource.Name}' is invalid: {message}"); 772throw new DistributedApplicationException($"The URL parameter '{externalService.Resource.UrlParameter.Name}' for the external service '{externalService.Resource.Name}' is invalid: {message}"); 950throw 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 Aspire see: https://aka.ms/dotnet/aspire/networking"); 1562throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself."); 1567throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'."); 1666throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself."); 1671throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'."); 1764throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself."); 1769throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'."); 1821throw new DistributedApplicationException($"Resource '{builder.Resource.Name}' already has a health check with key '{key}'."); 1904?? throw new DistributedApplicationException($"Could not create HTTP health check for resource '{builder.Resource.Name}' as the endpoint selector returned null."); 1908throw new DistributedApplicationException($"Could not create HTTP health check for resource '{builder.Resource.Name}' as the endpoint with name '{endpoint.EndpointName}' and scheme '{endpoint.Scheme}' is not an HTTP endpoint."); 1920throw new DistributedApplicationException($"The endpoint '{endpointName}' does not exist on the resource '{builder.Resource.Name}'."); 1942throw new DistributedApplicationException($"The URI for the health check is not set. Ensure that the resource has been allocated before the health check is executed."); 2257?? throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as the endpoint selector returned null."); 2261throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as the endpoint with name '{endpoint.EndpointName}' and scheme '{endpoint.Scheme}' is not an HTTP endpoint."); 2736throw new DistributedApplicationException($"Could not create {errorDisplayNoun} for resource '{builder.Resource.Name}' as the endpoint with name '{matchingEndpoint.EndpointName}' and scheme '{matchingEndpoint.Scheme}' is not an HTTP endpoint."); 2744throw new DistributedApplicationException($"Could not create {errorDisplayNoun} for resource '{builder.Resource.Name}' as no endpoint was found matching one of the specified names: {endpointNamesString}"); 2764throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as it has no HTTP endpoints."); 3191var endpoint = endpointSelector() ?? throw new DistributedApplicationException($"Could not create HTTP probe for resource '{builder.Resource.Name}' as the endpoint selector returned null.");
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (3)
21throw new DistributedApplicationException(LaunchProfileStrings.ProjectDoesNotContainMetadataExceptionMessage); 63throw new DistributedApplicationException(message); 80throw new DistributedApplicationException(message);
Aspire.Hosting.Azure (3)
Exceptions.cs (3)
9public AzureCliNotOnPathException(string message) : base(message) { } 16public MissingConfigurationException(string message) : base(message) { } 23public FailedToApplyEnvironmentException(string message) : base(message) { }
Aspire.Hosting.Azure.AppService (1)
AzureAppServiceEnvironmentResource.cs (1)
211throw new DistributedApplicationException("App Service configuration validation failed. See errors above.");
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBExtensions.cs (1)
110throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{builder.Resource.Name}' resource but the connection string was null.");
Aspire.Hosting.Azure.Functions (3)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (3)
21throw new DistributedApplicationException(LaunchProfileStrings.ProjectDoesNotContainMetadataExceptionMessage); 63throw new DistributedApplicationException(message); 80throw new DistributedApplicationException(message);
Aspire.Hosting.Azure.Kusto (5)
AzureKustoBuilderExtensions.cs (5)
123throw new DistributedApplicationException($"ConnectionStringAvailableEvent published for resource '{db.Name}', but the connection string was null."); 234throw new DistributedApplicationException($"ConnectionStringAvailableEvent published for resource '{resource.Name}', but the connection string was null."); 250throw new DistributedApplicationException($"Connection string for Kusto resource '{server.Name}' is not set."); 365throw new DistributedApplicationException($"Connection string for Kusto resource '{resourceBuilder.Resource.Name}' is not set."); 380throw new DistributedApplicationException($"Connection string for Kusto resource '{resourceBuilder.Resource.Name}' is not set.");
Aspire.Hosting.Azure.Storage (2)
AzureStorageExtensions.cs (2)
215var blobConnectionString = await builder.Resource.GetBlobConnectionString().GetValueAsync(ct).ConfigureAwait(false) ?? throw new DistributedApplicationException($"{nameof(ConnectionStringAvailableEvent)} was published for the '{builder.Resource.Name}' resource but the connection string was null."); 218var queueConnectionString = await builder.Resource.GetQueueConnectionString().GetValueAsync(ct).ConfigureAwait(false) ?? throw new DistributedApplicationException($"{nameof(ConnectionStringAvailableEvent)} was published for the '{builder.Resource.Name}' resource but the connection string was null.");
Aspire.Hosting.DevTunnels (10)
DevTunnelCliClient.cs (9)
49throw new DistributedApplicationException($"Failed to get devtunnel CLI version. Output: '{output}'. Error: '{error}'"); 124throw new DistributedApplicationException($"Failed to create dev tunnel '{tunnelId}' after {attempts} attempts. Exit code {exitCode}: {error}"); 134return tunnel ?? throw new DistributedApplicationException($"Failed to get dev tunnel '{tunnelId}'. Exit code {exitCode}: {error}"); 143return ports ?? throw new DistributedApplicationException($"Failed to get port list for dev tunnel '{tunnelId}'. Exit code {exitCode}: {error}"); 212throw new DistributedApplicationException($"Failed to create port '{portNumber}' for tunnel '{tunnelId}' after {attempts} attempts. Exit code {exitCode}: {error}"); 221return result ?? throw new DistributedApplicationException($"Failed to delete port '{portNumber}' on dev tunnel '{tunnelId}'. Exit code {exitCode}: {error}"); 230return access ?? throw new DistributedApplicationException($"Failed to get access details for '{tunnelId}'{(portNumber.HasValue ? $" port {portNumber}" : "")}. Exit code {exitCode}: {error}"); 239return login ?? throw new DistributedApplicationException($"Failed to get user login status. Exit code {exitCode}: {error}"); 258throw new DistributedApplicationException($"Failed to perform user login. Process finished with exit code: {exitCode}");
DevTunnelResourceBuilderExtensions.cs (1)
139throw new DistributedApplicationException(result.ValidationMessage);
Aspire.Hosting.Garnet (1)
GarnetBuilderExtensions.cs (1)
122throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{garnet.Name}' resource but the connection string was null.");
Aspire.Hosting.Kafka (1)
KafkaBuilderExtensions.cs (1)
48throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{kafka.Name}' resource but the connection string was null.");
Aspire.Hosting.Maui (3)
MauiiOSExtensions.cs (2)
203throw new DistributedApplicationException( 385throw new DistributedApplicationException(
MauiPlatformHelper.cs (1)
92throw new DistributedApplicationException(
Aspire.Hosting.MongoDB (2)
MongoDBBuilderExtensions.cs (2)
71throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{mongoDBContainer.Name}' resource but the connection string was null."); 123throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{mongoDBDatabase.Name}' resource but the connection string was null.");
Aspire.Hosting.MySql (3)
MySqlBuilderExtensions.cs (3)
52throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{resource.Name}' resource but the connection string was null."); 60throw new DistributedApplicationException($"ResourceReadyEvent was published for the '{resource.Name}' resource but the connection string was null."); 133throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{name}' resource but the connection string was null.");
Aspire.Hosting.Nats (1)
NatsBuilderExtensions.cs (1)
67?? throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{nats.Name}' resource but the connection string was null.");
Aspire.Hosting.Oracle (1)
OracleDatabaseBuilderExtensions.cs (1)
50throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{oracleDatabaseServer.Name}' resource but the connection string was null.");
Aspire.Hosting.PostgreSQL (3)
PostgresBuilderExtensions.cs (3)
67throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{postgresServer.Name}' resource but the connection string was null."); 75throw new DistributedApplicationException($"ResourceReadyEvent was published for the '{postgresServer.Name}' resource but the connection string was null."); 164throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{name}' resource but the connection string was null.");
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
56?? throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{qdrant.Name}' resource but the connection string was null.");
Aspire.Hosting.RabbitMQ (2)
RabbitMQBuilderExtensions.cs (2)
52throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{rabbitMq.Name}' resource but the connection string was null."); 216throw 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)
86throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{redis.Name}' resource but the connection string was null.");
Aspire.Hosting.SqlServer (3)
SqlServerBuilderExtensions.cs (3)
69throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{sqlServer.Name}' resource but the connection string was null."); 76throw new DistributedApplicationException($"ResourceReadyEvent was published for the '{sqlServer.Name}' resource but the connection string was null."); 141throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{name}' resource but the connection string was null.");
Aspire.Hosting.Tests (3)
DistributedApplicationTests.cs (3)
62throw new DistributedApplicationException(exceptionMessage); 107throw new DistributedApplicationException(exceptionMessage); 550throw new DistributedApplicationException(exceptionMessage);
Aspire.Hosting.Valkey (1)
ValkeyBuilderExtensions.cs (1)
135throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{valkey.Name}' resource but the connection string was null.");