3 types derived from DistributedApplicationException
Aspire.Hosting (1)
Exceptions.cs (1)
6internal class FailedToApplyEnvironmentException : DistributedApplicationException
Aspire.Hosting.Azure (2)
Exceptions.cs (2)
6internal sealed class AzureCliNotOnPathException : DistributedApplicationException 13internal sealed class FailedToApplyEnvironmentException : DistributedApplicationException
91 instantiations of DistributedApplicationException
Aspire.Hosting (59)
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)
103throw 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());
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)
63throw new DistributedApplicationException($"Failed to acquire semaphore for settings file: {settingsPath}"); 154throw new DistributedApplicationException("Codespaces or Devcontainer not detected.");
DistributedApplicationBuilder.cs (5)
126_ => throw new DistributedApplicationException("Invalid operation specified. Valid operations are 'publish' or 'run'.") 133_ => throw new DistributedApplicationException("Invalid operation specified. Valid operations are 'publish' or 'run'.") 406throw new DistributedApplicationException($"The dashboard resource '{KnownResourceNames.AspireDashboard}' does not have endpoints."); 506throw new DistributedApplicationException($"Multiple resources with the name '{duplicateResourceName}'. Resource names are case-insensitive."); 529throw 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.");
DistributedApplicationRunner.cs (1)
77throw new DistributedApplicationException($"Publishing failed exception message: {ex.Message}", ex);
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."); 194throw 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\Publisher.cs (1)
20throw new DistributedApplicationException(
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 (15)
586throw 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"); 1068throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself."); 1073throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'."); 1164throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself."); 1169throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'."); 1220throw new DistributedApplicationException($"Resource '{builder.Resource.Name}' already has a health check with key '{key}'."); 1302?? throw new DistributedApplicationException($"Could not create HTTP health check for resource '{builder.Resource.Name}' as the endpoint selector returned null."); 1306throw 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."); 1318throw new DistributedApplicationException($"The endpoint '{endpointName}' does not exist on the resource '{builder.Resource.Name}'."); 1340throw new DistributedApplicationException($"The URI for the health check is not set. Ensure that the resource has been allocated before the health check is executed."); 1654?? throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as the endpoint selector returned null."); 1658throw 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."); 1766throw 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."); 1774throw new DistributedApplicationException($"Could not create {errorDisplayNoun} for resource '{builder.Resource.Name}' as no endpoint was found matching one of the specified names: {endpointNamesString}"); 1794throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as it has no HTTP endpoints.");
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (4)
18throw new DistributedApplicationException(Resources.ProjectDoesNotContainMetadataExceptionMessage); 60throw new DistributedApplicationException(message); 77throw new DistributedApplicationException(message); 103throw new DistributedApplicationException(message, ex);
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.Functions (4)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (4)
18throw new DistributedApplicationException(Resources.ProjectDoesNotContainMetadataExceptionMessage); 60throw new DistributedApplicationException(message); 77throw new DistributedApplicationException(message); 103throw new DistributedApplicationException(message, ex);
Aspire.Hosting.Azure.Storage (3)
AzureStorageExtensions.cs (3)
140throw new DistributedApplicationException($"BeforeResourceStartedEvent was published for the '{builder.Resource.Name}' resource but the connection string was null."); 150throw new DistributedApplicationException($"BlobServiceClient was not created for the '{builder.Resource.Name}' resource."); 156throw new DistributedApplicationException($"ResourceReadyEvent was published for the '{builder.Resource.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.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 (3)
MySqlBuilderExtensions.cs (3)
49throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{resource.Name}' resource but the connection string was null."); 57throw new DistributedApplicationException($"ResourceReadyEvent was published for the '{resource.Name}' resource but the connection string was null."); 115throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{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."); 211throw 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.Testing (1)
DistributedApplicationFactory.cs (1)
367throw new DistributedApplicationException(message, ex);
Aspire.Hosting.Tests (3)
DistributedApplicationTests.cs (3)
57throw new DistributedApplicationException(exceptionMessage); 98throw new DistributedApplicationException(exceptionMessage); 311throw new DistributedApplicationException(exceptionMessage);
Aspire.Hosting.Valkey (1)
ValkeyBuilderExtensions.cs (1)
131throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{valkey.Name}' resource but the connection string was null.");
87 references to DistributedApplicationException
Aspire.Hosting (18)
ApplicationModel\ResourceNotificationService.cs (2)
270/// will throw a <see cref="DistributedApplicationException"/> if the resource enters an 364/// <exception cref="DistributedApplicationException"></exception>
Dcp\DcpDependencyCheck.cs (1)
111(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)
131/// <exception cref="DistributedApplicationException">Thrown when a resource with the same name already exists.</exception>
ParameterResourceBuilderExtensions.cs (2)
21/// <exception cref="DistributedApplicationException"></exception> 184/// <exception cref="DistributedApplicationException"></exception>
Publishing\ManifestPublishingContext.cs (2)
53/// <exception cref="DistributedApplicationException">Throws when could not get the directory directory name from the output path.</exception> 251/// <exception cref="DistributedApplicationException">Thrown if the container resource does not contain a <see cref="ContainerImageAnnotation"/>.</exception>
ResourceBuilderExtensions.cs (7)
373/// <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> 569/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 619/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 637/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 657/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 1044/// will throw a <see cref="DistributedApplicationException"/> if the resource enters an unavailable state.</para> 1597/// <exception cref="DistributedApplicationException"></exception>
Aspire.Hosting.MongoDB.Tests (2)
AddMongoDBTests.cs (2)
237Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 249Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
308Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 320Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
Aspire.Hosting.Oracle.Tests (2)
AddOracleTests.cs (2)
270Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 282Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
Aspire.Hosting.PostgreSQL.Tests (2)
AddPostgresTests.cs (2)
596Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 608Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
Aspire.Hosting.Python (1)
VirtualEnvironment.cs (1)
51/// <exception cref="DistributedApplicationException">Gets thrown when the executable couldn't be located.</exception>
Aspire.Hosting.RabbitMQ (2)
RabbitMQBuilderExtensions.cs (2)
124/// Calling this method on a resource configured with an unrecognized image registry, name, or tag will result in a <see cref="DistributedApplicationException"/> being thrown. 129/// <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)
166Assert.Throws<DistributedApplicationException>(rabbitmq.WithManagementPlugin); 179Assert.Throws<DistributedApplicationException>(rabbitmq.WithManagementPlugin); 193Assert.Throws<DistributedApplicationException>(rabbitmq.WithManagementPlugin);
Aspire.Hosting.SqlServer.Tests (2)
AddSqlServerTests.cs (2)
203Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 215Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
Aspire.Hosting.Tests (53)
Dcp\DcpExecutorTests.cs (1)
1142var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => await appExecutor.StartResourceAsync(resourceReference, CancellationToken.None));
DistributedApplicationBuilderTests.cs (8)
135var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddResource(new ContainerResource("Test"))); 146var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddResource(new ContainerResource("TEST"))); 158var ex = Assert.Throws<DistributedApplicationException>(appBuilder.Build); 170var ex = Assert.Throws<DistributedApplicationException>(appBuilder.Build);
DistributedApplicationTests.cs (5)
61var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 102var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 316Assert.IsType<DistributedApplicationException>(ex.InnerExceptions.First());
ExpressionResolverTests.cs (1)
36data.Add(new ExpressionResolverTestData(false, new ConnectionStringReference(new TestExpressionResolverResource("Empty"), false)), typeof(DistributedApplicationException), null);
HealthCheckTests.cs (6)
26var ex = Assert.Throws<DistributedApplicationException>(() => 46var ex = Assert.Throws<DistributedApplicationException>(() => 63var ex = Assert.Throws<DistributedApplicationException>(() =>
ProjectResourceTests.cs (6)
24var ex = Assert.Throws<DistributedApplicationException>(() => 275var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddProject<TestProject>("projectName")); 285var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddProject<Projects.ServiceA>("projectName", launchProfileName: "not-exist"));
WaitForTests.cs (11)
45var waitForEx = Assert.Throws<DistributedApplicationException>(() => 52var waitForCompletionEx = Assert.Throws<DistributedApplicationException>(() => 67var waitForEx = Assert.Throws<DistributedApplicationException>(() => 74var waitForCompletionEx = Assert.Throws<DistributedApplicationException>(() => 242var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => { 279[InlineData(WaitBehavior.StopOnResourceUnavailable, typeof(DistributedApplicationException), "Stopped waiting for resource 'redis' to become healthy because it failed to start.")]
WithEndpointTests.cs (6)
159var ex = Assert.Throws<DistributedApplicationException>(() => 174var ex = Assert.Throws<DistributedApplicationException>(() => 189var ex = Assert.Throws<DistributedApplicationException>(() =>
WithEnvironmentTests.cs (2)
164var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () => await EnvironmentVariableEvaluator.GetEnvironmentVariablesAsync(
WithHttpCommandTests.cs (4)
45var ex = Assert.Throws<DistributedApplicationException>(() => 67var ex = Assert.Throws<DistributedApplicationException>(() =>
WithReferenceTests.cs (3)
161await Assert.ThrowsAsync<DistributedApplicationException>(async () => 194var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () =>