7 types derived from DistributedApplicationException
Aspire.Hosting (3)
Exceptions.cs (1)
6internal class FailedToApplyEnvironmentException : DistributedApplicationException
MissingParameterValueException.cs (1)
17public class MissingParameterValueException : DistributedApplicationException
Publishing\ProcessFailedException.cs (1)
11internal sealed class ProcessFailedException : DistributedApplicationException
Aspire.Hosting.Azure (4)
Exceptions.cs (4)
6internal sealed class AzureCliNotOnPathException : DistributedApplicationException 13internal sealed class MissingConfigurationException : DistributedApplicationException 20internal sealed class FailedToApplyEnvironmentException : DistributedApplicationException 27internal sealed class ProvisioningFailedException : DistributedApplicationException
204 instantiations of DistributedApplicationException
Aspire.Hosting (83)
ApplicationModel\ConnectionStringReference.cs (1)
41internal void ThrowConnectionStringUnavailableException() => throw new DistributedApplicationException($"The connection string for the resource '{Resource.Name}' is not available.");
ApplicationModel\ResourceCollection.cs (1)
120throw new DistributedApplicationException($"Cannot add resource of type '{newResource.GetType()}' with name '{newResource.Name}' because resource of type '{existingResource.GetType()}' with that name already exists. Resource names are case-insensitive.");
ApplicationModel\ResourceNotificationService.cs (9)
252throw new DistributedApplicationException($"Stopped waiting for resource '{resourceName}' to become healthy because it does not exist in the application model."); 266throw new DistributedApplicationException($"Stopped waiting for resource '{resourceName}' to become healthy because it failed to start."); 295_ => throw new DistributedApplicationException($"Unexpected wait behavior: {waitBehavior}") 342throw new DistributedApplicationException($"Resource '{resource.Name}' stopped waiting for dependency resource '{displayName}' because it failed to start."); 354throw new DistributedApplicationException( 408throw new DistributedApplicationException($"Resource '{resource.Name}' stopped waiting for dependency resource '{displayName}' because it failed to start."); 420throw new DistributedApplicationException( 443_ => throw new DistributedApplicationException($"Unexpected wait behavior: {waitBehavior}") 558_ => throw new DistributedApplicationException($"Unexpected wait type: {waitAnnotation.WaitType}")
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
680throw new DistributedApplicationException($"Stopped waiting for resource '{target.DisplayName}' to become healthy because it failed to start.");
Dashboard\DashboardEventHandlers.cs (3)
149throw new DistributedApplicationException($"Failed to parse AppHost runtime config: {runtimeConfigPath}"); 241throw new DistributedApplicationException($"Failed to parse dashboard runtime config: {originalRuntimeConfig}"); 281throw new DistributedApplicationException("Dashboard path empty or file does not exist.");
Dcp\ContainerCreator.cs (4)
230throw new DistributedApplicationException($"Container resource name '{container.Name}' conflicts with the Aspire container tunnel container name '{ContainerTunnelContainerName}'. Rename the resource or disable the Aspire container tunnel."); 236throw new DistributedApplicationException($"Container resource '{container.Name}' uses container name '{containerNameAnnotation.Name}', which conflicts with the Aspire container tunnel container name '{ContainerTunnelContainerName}'. Rename the container or disable the Aspire container tunnel."); 243throw new DistributedApplicationException($"Container resource '{container.Name}' uses network alias '{aliasAnnotation.Alias}', which conflicts with the Aspire container tunnel container name '{ContainerTunnelContainerName}'. Rename the alias or disable the Aspire container tunnel."); 631throw new DistributedApplicationException(
Dcp\DcpDependencyCheck.cs (5)
88throw new DistributedApplicationException(string.Format( 116throw new DistributedApplicationException(string.Format( 161throw new DistributedApplicationException(string.Format( 243throw new DistributedApplicationException($"Container runtime '{containerRuntime}' could not be found. See https://aka.ms/aspire/containers for more details on supported container runtimes."); 262throw new DistributedApplicationException(message);
Dcp\DcpExecutor.cs (3)
1081throw new DistributedApplicationException($"Couldn't find required {nameof(DcpInstancesAnnotation)} annotation on resource {resource.Name}."); 1092throw new DistributedApplicationException($"Couldn't find required instance ID for index {instanceIndex} on resource {resource.Name}."); 1326throw new DistributedApplicationException($"Failed to delete '{resource.DcpResourceName}' successfully before restart.");
Dcp\HostDashboardEndpointProvider.cs (1)
25throw new DistributedApplicationException("Error getting the resource service URL.", ex);
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 (2)
155_ => throw new DistributedApplicationException("Invalid operation specified. Valid operations are 'publish', 'run', or 'inspect'.") 855throw new DistributedApplicationException($"Multiple resources with the name '{duplicateResourceName}'. Resource names are case-insensitive.");
McpServerResourceBuilderExtensions.cs (2)
62throw new DistributedApplicationException( 79throw new DistributedApplicationException(
Pipelines\DistributedApplicationPipeline.cs (2)
210throw new DistributedApplicationException( 448throw new DistributedApplicationException(
ProjectResourceBuilderExtensions.cs (2)
433throw new DistributedApplicationException(message); 525throw new DistributedApplicationException($"File-based apps are only supported on .NET 10 or later. The version active in '{projectDirectory}' is {version}.");
Publishing\ContainerRuntimeBase.cs (5)
142throw new DistributedApplicationException(message); 188throw new DistributedApplicationException(message); 393throw new DistributedApplicationException(message); 442throw new DistributedApplicationException( 617throw new DistributedApplicationException(
Publishing\DockerContainerRuntime.cs (1)
134throw new DistributedApplicationException(
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)
70var manifestDirectory = Path.GetDirectoryName(fullyQualifiedManifestPath) ?? throw new DistributedApplicationException("Could not get directory name of output path"); 179throw new DistributedApplicationException($"Project metadata was not found for resource '{project.Name}'."); 329throw new DistributedApplicationException($"Could not get the container image name for resource '{container.Name}'.");
Publishing\ManifestPublishingExtensions.cs (1)
40throw new DistributedApplicationException(
Publishing\PipelineExecutor.cs (1)
97throw new DistributedApplicationException($"Pipeline execution failed: {ex.Message}", ex);
Publishing\ResourceContainerImageManager.cs (1)
332throw new DistributedApplicationException($"The resource '{resource.Name}' does not have a project metadata annotation.");
ResourceBuilderExtensions.cs (26)
447throw new DistributedApplicationException($"The URL parameter '{externalService.Resource.UrlParameter.Name}' for source resource '{externalService.Resource.Name}' is invalid while configuring target resource '{builder.Resource.Name}': {message}"); 1352throw new DistributedApplicationException($"The URL parameter '{externalService.Resource.UrlParameter.Name}' for source resource '{externalService.Resource.Name}' is invalid while configuring target resource '{builder.Resource.Name}': {message}"); 2436throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself."); 2441throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'."); 2559throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself."); 2564throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'."); 2662throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself."); 2667throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'."); 2722throw new DistributedApplicationException($"Resource '{builder.Resource.Name}' already has a health check with key '{key}'."); 2809?? throw new DistributedApplicationException($"Could not create HTTP health check for resource '{builder.Resource.Name}' as the endpoint selector returned null."); 2813throw 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."); 2826throw new DistributedApplicationException($"The endpoint '{endpointName}' does not exist on the resource '{builder.Resource.Name}'."); 3331throw new DistributedApplicationException("Process command output line count must be greater than zero."); 3371throw new DistributedApplicationException("Process command requires a non-empty executable path."); 3379throw new DistributedApplicationException("Process command arguments cannot contain null values."); 3406throw new DistributedApplicationException("Process command environment variables require non-empty names."); 3411throw new DistributedApplicationException($"Process command environment variable '{name}' requires a value."); 3427throw new DistributedApplicationException($"Process command '{processCommandSpec.ExecutablePath}' arguments cannot contain null values."); 3436throw new DistributedApplicationException($"Process command '{processCommandSpec.ExecutablePath}' environment variables require non-empty names."); 3441throw new DistributedApplicationException($"Process command '{processCommandSpec.ExecutablePath}' environment variable '{name}' requires a value."); 3684?? throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as the endpoint selector returned null."); 3688throw 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."); 4382throw 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."); 4390throw new DistributedApplicationException($"Could not create {errorDisplayNoun} for resource '{builder.Resource.Name}' as no endpoint was found matching one of the specified names: {endpointNamesString}"); 4410throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as it has no HTTP endpoints."); 5074var 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)
20throw new DistributedApplicationException(LaunchProfileStrings.ProjectDoesNotContainMetadataExceptionMessage); 62throw new DistributedApplicationException(message); 79throw new DistributedApplicationException(message);
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (1)
53throw new DistributedApplicationException(ex.Message, ex.InnerException ?? ex);
Aspire.Hosting.Azure.AppContainers (2)
AzureContainerAppExtensions.cs (1)
209throw new DistributedApplicationException(
src\Shared\CrossScopeAcrPullIdentityPreparer.cs (1)
122throw new DistributedApplicationException(
Aspire.Hosting.Azure.AppService (2)
AzureAppServiceEnvironmentResource.cs (1)
307throw new DistributedApplicationException("App Service configuration validation failed. See errors above.");
src\Shared\CrossScopeAcrPullIdentityPreparer.cs (1)
122throw new DistributedApplicationException(
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBExtensions.cs (1)
126throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{builder.Resource.Name}' resource but the connection string was null.");
Aspire.Hosting.Azure.Functions (4)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (3)
20throw new DistributedApplicationException(LaunchProfileStrings.ProjectDoesNotContainMetadataExceptionMessage); 62throw new DistributedApplicationException(message); 79throw new DistributedApplicationException(message);
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (1)
53throw new DistributedApplicationException(ex.Message, ex.InnerException ?? ex);
Aspire.Hosting.Azure.Kusto (5)
AzureKustoBuilderExtensions.cs (5)
128throw new DistributedApplicationException($"ConnectionStringAvailableEvent published for resource '{db.Name}', but the connection string was null."); 243throw new DistributedApplicationException($"ConnectionStringAvailableEvent published for resource '{resource.Name}', but the connection string was null."); 259throw new DistributedApplicationException($"Connection string for Kusto resource '{server.Name}' is not set."); 386throw new DistributedApplicationException($"Connection string for Kusto resource '{resourceBuilder.Resource.Name}' is not set."); 401throw new DistributedApplicationException($"Connection string for Kusto resource '{resourceBuilder.Resource.Name}' is not set.");
Aspire.Hosting.Azure.Storage (2)
AzureStorageExtensions.cs (2)
218var 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."); 221var 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.Blazor (5)
BlazorHostedExtensions.cs (5)
229? new DistributedApplicationException(message, result.StartException) 230: new DistributedApplicationException(message); 240throw new DistributedApplicationException( 247throw new DistributedApplicationException( 272throw new DistributedApplicationException(
Aspire.Hosting.DevTunnels (13)
DevTunnelCliClient.cs (11)
63throw new DistributedApplicationException($"Failed to get devtunnel CLI version. Output: '{output}'. Error: '{error}'"); 104throw new DistributedApplicationException( 153throw new DistributedApplicationException($"Failed to create dev tunnel '{tunnelId}' after {attempts} attempts. Exit code {exitCode}: {error}"); 163return tunnel ?? throw new DistributedApplicationException($"Failed to get dev tunnel '{tunnelId}'. Exit code {exitCode}: {error}"); 172return ports ?? throw new DistributedApplicationException($"Failed to get port list for dev tunnel '{tunnelId}'. Exit code {exitCode}: {error}"); 241throw new DistributedApplicationException($"Failed to create port '{portNumber}' for tunnel '{tunnelId}' after {attempts} attempts. Exit code {exitCode}: {error}"); 250return result ?? throw new DistributedApplicationException($"Failed to delete port '{portNumber}' on dev tunnel '{tunnelId}'. Exit code {exitCode}: {error}"); 259return access ?? throw new DistributedApplicationException($"Failed to get access details for '{tunnelId}'{(portNumber.HasValue ? $" port {portNumber}" : "")}. Exit code {exitCode}: {error}"); 268return login ?? throw new DistributedApplicationException($"Failed to get user login status. Exit code {exitCode}: {error}"); 287throw new DistributedApplicationException($"Failed to perform user login. Process finished with exit code: {exitCode}"); 339throw new DistributedApplicationException($"Failed to parse JSON output into type '{typeof(T).Name}':\n{output}", ex);
DevTunnelResourceBuilderExtensions.cs (2)
138throw new DistributedApplicationException(result.ValidationMessage); 154var exception = new DistributedApplicationException($"Error trying to create the dev tunnel resource '{tunnelResource.TunnelId}' this port belongs to: {ex.Message}", ex);
Aspire.Hosting.Dotnet (7)
DotnetProjectHostingExtensions.cs (1)
213throw new DistributedApplicationException(message);
DotnetProjectResource.cs (2)
66Task.FromException(new DistributedApplicationException(GetUnsupportedPublishMessage(Name)))); 90Action = _ => throw new DistributedApplicationException(
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (3)
20throw new DistributedApplicationException(LaunchProfileStrings.ProjectDoesNotContainMetadataExceptionMessage); 62throw new DistributedApplicationException(message); 79throw new DistributedApplicationException(message);
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (1)
53throw new DistributedApplicationException(ex.Message, ex.InnerException ?? ex);
Aspire.Hosting.Foundry (4)
HostedAgent\AzureHostedAgentResource.cs (1)
407throw new DistributedApplicationException($"The connection string for the resource '{connectionStringReference.Resource.Name}' is not available.");
HostedAgent\HostedAgentConfiguration.cs (3)
161throw new DistributedApplicationException($"Foundry hosted agent for target resource '{targetResourceName}' must declare at least one protocol version."); 177throw new DistributedApplicationException( 195throw new DistributedApplicationException(
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.Java (19)
JavaDockerfileGenerator.cs (15)
355throw new DistributedApplicationException( 433throw new DistributedApplicationException( 441throw new DistributedApplicationException( 454static message => new DistributedApplicationException(message)); 574throw new DistributedApplicationException( 599throw new DistributedApplicationException( 611throw new DistributedApplicationException( 1006throw new DistributedApplicationException( 1042throw new DistributedApplicationException( 1053throw new DistributedApplicationException( 1059throw new DistributedApplicationException( 1078throw new DistributedApplicationException( 1094throw new DistributedApplicationException( 1151?? throw new DistributedApplicationException( 1174throw new DistributedApplicationException(
JavaHostingExtensions.cs (4)
135throw new DistributedApplicationException( 1254throw new DistributedApplicationException( 1537throw new DistributedApplicationException( 1545throw new DistributedApplicationException(
Aspire.Hosting.JavaScript (1)
JavaScriptHostingExtensions.cs (1)
1437throw new DistributedApplicationException(
Aspire.Hosting.Kafka (1)
KafkaBuilderExtensions.cs (1)
49throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{kafka.Name}' resource but the connection string was null.");
Aspire.Hosting.Maui (6)
MauiiOSExtensions.cs (2)
228throw new DistributedApplicationException( 430throw new DistributedApplicationException(
MauiOtlpExtensions.cs (3)
126throw new DistributedApplicationException($"The MAUI OTLP dev tunnel for resource '{parentBuilder.Resource.Name}' requires the Aspire dashboard to be enabled or an explicit OTLP endpoint URL to be configured."); 129throw new DistributedApplicationException($"The Aspire dashboard resource '{KnownResourceNames.AspireDashboard}' does not have an allocated OTLP endpoint named '{KnownEndpointNames.OtlpGrpcEndpointName}' or '{KnownEndpointNames.OtlpHttpEndpointName}', so the MAUI OTLP dev tunnel for resource '{parentBuilder.Resource.Name}' cannot start. Ensure dashboard OTLP ingestion is enabled, or configure an explicit OTLP endpoint URL."); 180throw new DistributedApplicationException($"The configured OTLP endpoint URL '{url}' from '{configKey}' must be an absolute HTTP or HTTPS URL.");
MauiPlatformHelper.cs (1)
140throw new DistributedApplicationException(
Aspire.Hosting.MongoDB (2)
MongoDBBuilderExtensions.cs (2)
73throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{mongoDBContainer.Name}' resource but the connection string was null."); 127throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{mongoDBDatabase.Name}' resource but the connection string was null.");
Aspire.Hosting.MySql (3)
MySqlBuilderExtensions.cs (3)
53throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{resource.Name}' resource but the connection string was null."); 61throw new DistributedApplicationException($"ResourceReadyEvent was published for the '{resource.Name}' resource but the connection string was null."); 136throw 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)
51throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{oracleDatabaseServer.Name}' resource but the connection string was null.");
Aspire.Hosting.PostgreSQL (3)
PostgresBuilderExtensions.cs (3)
69throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{postgresServer.Name}' resource but the connection string was null."); 77throw new DistributedApplicationException($"ResourceReadyEvent was published for the '{postgresServer.Name}' resource but the connection string was null."); 168throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{name}' resource but the connection string was null.");
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
57?? throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{qdrant.Name}' resource but the connection string was null.");
Aspire.Hosting.RabbitMQ (2)
RabbitMQBuilderExtensions.cs (2)
53throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{rabbitMq.Name}' resource but the connection string was null."); 233throw 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)
88throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{redis.Name}' resource but the connection string was null.");
Aspire.Hosting.RemoteHost.Tests (1)
CapabilityDispatcherTests.cs (1)
2232throw new DistributedApplicationException(
Aspire.Hosting.Rust (21)
CargoMetadata.cs (1)
91throw new DistributedApplicationException(
CargoMetadataReader.cs (4)
92throw new DistributedApplicationException( 111throw new DistributedApplicationException( 127throw new DistributedApplicationException( 137throw new DistributedApplicationException(
RustCargoTargetResolver.cs (4)
150[] => throw new DistributedApplicationException( 153var many => throw new DistributedApplicationException( 167?? throw new DistributedApplicationException( 186_ => throw new DistributedApplicationException(
RustDockerfileGenerator.cs (7)
212throw new DistributedApplicationException( 227throw new DistributedApplicationException( 243throw new DistributedApplicationException( 299throw new DistributedApplicationException( 314?? throw new DistributedApplicationException( 342throw new DistributedApplicationException( 373throw new DistributedApplicationException(
RustHostingExtensions.cs (5)
799throw new DistributedApplicationException( 905throw new DistributedApplicationException( 914throw new DistributedApplicationException( 921throw new DistributedApplicationException( 932=> new(
Aspire.Hosting.SqlServer (3)
SqlServerBuilderExtensions.cs (3)
70throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{sqlServer.Name}' resource but the connection string was null."); 77throw new DistributedApplicationException($"ResourceReadyEvent was published for the '{sqlServer.Name}' resource but the connection string was null."); 146throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{name}' resource but the connection string was null.");
Aspire.Hosting.Testing (1)
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (1)
53throw new DistributedApplicationException(ex.Message, ex.InnerException ?? ex);
Aspire.Hosting.Tests (4)
DistributedApplicationTests.cs (4)
70throw new DistributedApplicationException(exceptionMessage); 115throw new DistributedApplicationException(exceptionMessage); 146throw new DistributedApplicationException(exceptionMessage); 702throw new DistributedApplicationException(exceptionMessage);
Aspire.Hosting.TestUtilities (2)
Publishing\FakeContainerRuntime.cs (2)
113throw new DistributedApplicationException("Fake container runtime is configured to fail"); 124throw new DistributedApplicationException("Fake container runtime is configured to fail");
Aspire.Hosting.Valkey (1)
ValkeyBuilderExtensions.cs (1)
136throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{valkey.Name}' resource but the connection string was null.");
Aspire.Hosting.Yarp (1)
YarpJsonConfigGeneratorBuilder.cs (1)
70throw new DistributedApplicationException($"Error when reading the YARP config file '{_configFilePath}'", ex);
256 references to DistributedApplicationException
Aspire.Hosting (26)
ApplicationModel\ResourceNotificationService.cs (2)
233/// will throw a <see cref="DistributedApplicationException"/> if the resource enters an 475/// <exception cref="DistributedApplicationException"></exception>
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
663catch (DistributedApplicationException ex)
Backchannel\DashboardUrlsHelper.cs (1)
63catch (DistributedApplicationException ex)
Dcp\DcpDependencyCheck.cs (1)
113(ex is not DistributedApplicationException
DistributedApplicationException.cs (3)
12/// Initializes a new instance of the <see cref="DistributedApplicationException"/> class. 18/// Initializes a new instance of the <see cref="DistributedApplicationException"/> class, 26/// Initializes a new instance of the <see cref="DistributedApplicationException"/> class,
IDistributedApplicationBuilder.cs (1)
184/// <exception cref="DistributedApplicationException">Thrown when a resource with the same name already exists.</exception>
ParameterResourceBuilderExtensions.cs (2)
26/// <exception cref="DistributedApplicationException"></exception> 320/// <exception cref="DistributedApplicationException"></exception>
Pipelines\DistributedApplicationPipeline.cs (1)
1136catch (DistributedApplicationException)
Publishing\ContainerRuntimeBase.cs (1)
623catch (DistributedApplicationException)
Publishing\IContainerRuntime.cs (2)
75/// <exception cref="DistributedApplicationException">Thrown when the compose up command fails.</exception> 83/// <exception cref="DistributedApplicationException">Thrown when the compose down command fails.</exception>
Publishing\ManifestPublishingContext.cs (2)
60/// <exception cref="DistributedApplicationException">Throws when could not get the directory directory name from the output path.</exception> 314/// <exception cref="DistributedApplicationException">Thrown if the container resource does not contain a <see cref="ContainerImageAnnotation"/>.</exception>
ResourceBuilderExtensions.cs (8)
1103/// <exception cref="DistributedApplicationException">Throws an exception if the connection string resolves to null. It can be null if the resource has no connection string, and if the configuration has no connection string for the source resource.</exception> 1559/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 1633/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 1718/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 1743/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 2411/// will throw a <see cref="DistributedApplicationException"/> if the resource enters an unavailable state.</para> 2534/// will throw a <see cref="DistributedApplicationException"/> if the resource enters an unavailable state.</para> 3623/// <exception cref="DistributedApplicationException"></exception>
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (1)
38/// <exception cref="DistributedApplicationException">Thrown when the file is empty or contains malformed JSON.</exception>
Aspire.Hosting.Azure.Functions (1)
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (1)
38/// <exception cref="DistributedApplicationException">Thrown when the file is empty or contains malformed JSON.</exception>
Aspire.Hosting.Azure.Tests (10)
AzureContainerAppEnvironmentExtensionsTests.cs (2)
325var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
AzureContainerAppsTests.cs (8)
2008var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => app.RunAsync()); 2185var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => app.RunAsync()); 2214var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => app.RunAsync()); 2243var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => app.RunAsync());
Aspire.Hosting.Blazor.Tests (2)
BlazorHostedExtensionsTests.cs (2)
276var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
154var exception = new DistributedApplicationException($"Error trying to create the dev tunnel resource '{tunnelResource.TunnelId}' this port belongs to: {ex.Message}", ex);
Aspire.Hosting.DevTunnels.Tests (2)
DevTunnelCliClientTests.cs (2)
33var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
Aspire.Hosting.Dotnet (1)
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (1)
38/// <exception cref="DistributedApplicationException">Thrown when the file is empty or contains malformed JSON.</exception>
Aspire.Hosting.Dotnet.Tests (11)
DotnetProjectResourceTests.cs (11)
128var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 145var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 162await Assert.ThrowsAsync<DistributedApplicationException>( 193await Assert.ThrowsAsync<DistributedApplicationException>(() => ExecutePipelineAsync(app)); 236await Assert.ThrowsAsync<DistributedApplicationException>(() => ExecutePipelineAsync(app)); 336await Assert.ThrowsAsync<DistributedApplicationException>( 353var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 905DistributedApplicationException exception,
Aspire.Hosting.Foundry.Tests (6)
HostedAgentConfigurationTests.cs (6)
104var ex = Assert.Throws<DistributedApplicationException>(() => config.ToProjectsAgentVersionCreationOptions("target")); 152var ex = Assert.Throws<DistributedApplicationException>(() => config.ToProjectsAgentVersionCreationOptions("target")); 167var ex = Assert.Throws<DistributedApplicationException>(() => config.ToProjectsAgentVersionCreationOptions("target"));
Aspire.Hosting.Java (5)
JavaDockerfileGenerator.cs (5)
97/// <exception cref="DistributedApplicationException">No build tool is configured and none can be found on disk.</exception> 288/// <exception cref="DistributedApplicationException">The JAR is outside the build context.</exception> 388/// <exception cref="DistributedApplicationException">The path reaches outside the build context or contains whitespace.</exception> 980/// <exception cref="DistributedApplicationException">The properties file is missing.</exception> 1030/// <exception cref="DistributedApplicationException">No wrapper is present, or the configured wrapper is outside the build context.</exception>
Aspire.Hosting.Java.Tests (48)
AddJavaAppPublishTests.cs (40)
156var exception = Assert.Throws<DistributedApplicationException>( 206var exception = Assert.Throws<DistributedApplicationException>( 242var ex = Assert.Throws<DistributedApplicationException>( 289var exception = Assert.Throws<DistributedApplicationException>( 440var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 780var exception = Assert.Throws<DistributedApplicationException>( 868var ex = Assert.Throws<DistributedApplicationException>( 889var ex = Assert.Throws<DistributedApplicationException>( 912var ex = Assert.Throws<DistributedApplicationException>( 935var ex = Assert.Throws<DistributedApplicationException>( 1020var ex = Assert.Throws<DistributedApplicationException>( 1047var ex = Assert.Throws<DistributedApplicationException>( 1614var exception = Assert.Throws<DistributedApplicationException>( 1631var exception = Assert.Throws<DistributedApplicationException>( 1749var ex = Assert.Throws<DistributedApplicationException>( 1898var exception = Assert.Throws<DistributedApplicationException>( 1919var exception = Assert.Throws<DistributedApplicationException>( 1936var exception = Assert.Throws<DistributedApplicationException>( 1951var exception = Assert.Throws<DistributedApplicationException>( 1999var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
AddJavaAppTests.cs (6)
745var ex = await Assert.ThrowsAsync<DistributedApplicationException>( 764var ex = await Assert.ThrowsAsync<DistributedApplicationException>( 852var ex = await Assert.ThrowsAsync<DistributedApplicationException>(
AddSpringBootAppTests.cs (2)
216var publishException = Assert.Throws<DistributedApplicationException>(
Aspire.Hosting.JavaScript.Tests (10)
AddJavaScriptAppTests.cs (10)
203var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => ManifestUtils.GetManifest(app.Resource, workspace.Path)); 222var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => ManifestUtils.GetManifestForModel(appModel, workspace.Path)); 240var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => ManifestUtils.GetManifest(app.Resource, workspace.Path)); 267var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => pipeline.ExecuteAsync(context)); 337var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => ManifestUtils.GetManifest(app.Resource, workspace.Path));
Aspire.Hosting.Maui.Tests (14)
MauiiOSValidationTests.cs (4)
32var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 57var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () =>
MauiPlatformExtensionsTests.cs (10)
146var exception = Assert.Throws<DistributedApplicationException>(() => 290var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 806var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => 831var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => 852var exception = Assert.Throws<DistributedApplicationException>(() => androidEmulator.WithOtlpDevTunnel());
Aspire.Hosting.MongoDB.Tests (2)
AddMongoDBTests.cs (2)
256Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 268Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
299Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 311Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
Aspire.Hosting.Oracle.Tests (2)
AddOracleTests.cs (2)
269Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 281Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
Aspire.Hosting.PostgreSQL.Tests (2)
AddPostgresTests.cs (2)
600Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 612Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
Aspire.Hosting.RabbitMQ (2)
RabbitMQBuilderExtensions.cs (2)
131/// Calling this method on a resource configured with an unrecognized image registry, name, or tag will result in a <see cref="DistributedApplicationException"/> being thrown. 136/// <exception cref="DistributedApplicationException">Thrown when the current container image and tag do not match the defaults for <see cref="RabbitMQServerResource"/>.</exception>
Aspire.Hosting.RabbitMQ.Tests (3)
AddRabbitMQTests.cs (3)
165Assert.Throws<DistributedApplicationException>(rabbitmq.WithManagementPlugin); 178Assert.Throws<DistributedApplicationException>(rabbitmq.WithManagementPlugin); 192Assert.Throws<DistributedApplicationException>(rabbitmq.WithManagementPlugin);
Aspire.Hosting.Rust (2)
CargoMetadataReader.cs (1)
135catch (Exception ex) when (ex is not DistributedApplicationException)
RustHostingExtensions.cs (1)
929private static DistributedApplicationException CreateUnsupportedContainerTargetException(
Aspire.Hosting.Rust.Tests (22)
AddRustAppPublishTests.cs (10)
154var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 181var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 205var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 232var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 261var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
CargoMetadataTests.cs (4)
69var exception = Assert.Throws<DistributedApplicationException>(() => CargoMetadata.Parse(Json)); 326var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
RustCargoTargetResolverTests.cs (8)
155var exception = Assert.Throws<DistributedApplicationException>(() => Resolve(metadata, new RustCargoOptionsAnnotation())); 170var exception = Assert.Throws<DistributedApplicationException>(() => Resolve(metadata, new RustCargoOptionsAnnotation())); 187var exception = Assert.Throws<DistributedApplicationException>( 202var exception = Assert.Throws<DistributedApplicationException>(() => Resolve(metadata, new RustCargoOptionsAnnotation()));
Aspire.Hosting.SqlServer.Tests (2)
AddSqlServerTests.cs (2)
202Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 214Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
Aspire.Hosting.Testing (2)
DistributedApplicationHostingTestingExtensions.cs (1)
47/// <exception cref="DistributedApplicationException">Thrown when the dashboard reaches a terminal failure state.</exception>
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (1)
38/// <exception cref="DistributedApplicationException">Thrown when the file is empty or contains malformed JSON.</exception>
Aspire.Hosting.Testing.Tests (2)
DashboardUrlTests.cs (2)
313var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
Aspire.Hosting.Tests (76)
ApplicationModel\ResourceCollectionTests.cs (6)
146var ex = Assert.Throws<DistributedApplicationException>(() => collection.Add(new TestResource("res"))); 157Assert.Throws<DistributedApplicationException>(() => collection.Add(new TestResource("RES"))); 166Assert.Throws<DistributedApplicationException>(() => collection.Insert(0, new TestResource("res"))); 177Assert.Throws<DistributedApplicationException>(() => collection[0] = new TestResource("res2")); 203Assert.Throws<DistributedApplicationException>(() => new ResourceCollection(resources));
BuildOnlyContainerValidationTests.cs (4)
29var ex = await Assert.ThrowsAsync<DistributedApplicationException>( 50var ex = await Assert.ThrowsAsync<DistributedApplicationException>(
Dcp\DcpExecutorTests.cs (8)
467var ex = await Assert.ThrowsAsync<DistributedApplicationException>(() => appExecutor.RunApplicationAsync()); 489var ex = await Assert.ThrowsAsync<DistributedApplicationException>(() => appExecutor.RunApplicationAsync()); 511var ex = await Assert.ThrowsAsync<DistributedApplicationException>(() => appExecutor.RunApplicationAsync()); 4144var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => await appExecutor.StartResourceAsync(resourceReference, CancellationToken.None));
DistributedApplicationBuilderTests.cs (4)
296var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddResource(new ContainerResource("Test"))); 307var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddResource(new ContainerResource("TEST")));
DistributedApplicationTests.cs (7)
75var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 120var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 151var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 708Assert.IsType<DistributedApplicationException>(ex.InnerExceptions.First());
ExpressionResolverTests.cs (1)
43data.Add(new ExpressionResolverTestData(false, new ConnectionStringReference(new TestExpressionResolverResource("Empty"), false)), typeof(DistributedApplicationException), null);
ExternalServiceTests.cs (4)
193var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 212var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () =>
HealthCheckTests.cs (6)
27var ex = Assert.Throws<DistributedApplicationException>(() => 47var ex = Assert.Throws<DistributedApplicationException>(() => 64var ex = Assert.Throws<DistributedApplicationException>(() =>
ProjectResourceTests.cs (6)
82var ex = Assert.Throws<DistributedApplicationException>(() => 347var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddProject<TestProject>("projectName")); 357var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddProject<Projects.ServiceA>("projectName", launchProfileName: "not-exist"));
PublishAsDockerfileTests.cs (4)
497var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => ManifestUtils.GetManifest(project)); 507var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => ManifestUtils.GetManifest(container));
Publishing\ContainerRuntimeBaseTests.cs (2)
21var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() =>
Publishing\ResourceContainerImageManagerTests.cs (1)
1357catch (DistributedApplicationException)
ResourceNotificationTests.cs (2)
1385var ex = await Assert.ThrowsAsync<DistributedApplicationException>(
WaitForTests.cs (13)
46var waitForEx = Assert.Throws<DistributedApplicationException>(() => 53var waitForCompletionEx = Assert.Throws<DistributedApplicationException>(() => 68var waitForEx = Assert.Throws<DistributedApplicationException>(() => 75var waitForCompletionEx = Assert.Throws<DistributedApplicationException>(() => 243var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => { 280[InlineData(WaitBehavior.StopOnResourceUnavailable, typeof(DistributedApplicationException), "Stopped waiting for resource 'redis' to become healthy because it failed to start.")] 839var waitForEx = Assert.Throws<DistributedApplicationException>(() =>
WithHttpCommandTests.cs (4)
161var ex = Assert.Throws<DistributedApplicationException>(() => 183var ex = Assert.Throws<DistributedApplicationException>(() =>
WithProcessCommandTests.cs (2)
1226var exception = Assert.Throws<DistributedApplicationException>(() =>
WithReferenceTests.cs (2)
308var inner = Assert.IsType<DistributedApplicationException>(aggregate.InnerException);