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
73 instantiations of DistributedApplicationException
Aspire.Hosting (41)
ApplicationModel\ConnectionStringReference.cs (1)
30throw new DistributedApplicationException($"The connection string for the resource '{Resource.Name}' is not available.");
ApplicationModel\ResourceNotificationService.cs (5)
160throw new DistributedApplicationException($"Dependency resource '{displayName}' failed to start."); 170throw new DistributedApplicationException( 249throw new DistributedApplicationException($"Dependency resource '{displayName}' failed to start."); 261throw new DistributedApplicationException( 303_ => throw new DistributedApplicationException($"Unexpected wait type: {waitAnnotation.WaitType}")
Dashboard\DashboardLifecycleHook.cs (1)
97throw new DistributedApplicationException("Dashboard path empty or file does not exist.");
Dcp\DcpDependencyCheck.cs (5)
85throw new DistributedApplicationException(string.Format( 111throw new DistributedApplicationException(string.Format( 160throw new DistributedApplicationException(string.Format( 194throw new DistributedApplicationException($"Container runtime '{containerRuntime}' could not be found. See https://aka.ms/dotnet/aspire/containers for more details on supported container runtimes."); 221throw new DistributedApplicationException(messageFormat.Replace("{Runtime}", containerRuntime).ToString());
Dcp\DcpExecutor.cs (3)
1102throw new DistributedApplicationException($"Couldn't find required {nameof(DcpInstancesAnnotation)} annotation on resource {resource.Name}."); 1113throw new DistributedApplicationException($"Couldn't find required instance ID for index {instanceIndex} on resource {resource.Name}."); 1584throw new DistributedApplicationException($"Failed to delete '{state}' 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)
63throw new DistributedApplicationException($"Failed to acquire semaphore for settings file: {settingsPath}"); 154throw new DistributedApplicationException("Codespaces or Devcontainer not detected.");
DistributedApplicationBuilder.cs (2)
417throw new DistributedApplicationException($"Multiple resources with the name '{duplicateResourceName}'. Resource names are case-insensitive."); 440throw 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.");
ParameterResourceBuilderExtensions.cs (2)
156?? throw new DistributedApplicationException($"Parameter resource could not be used because configuration key '{configurationKey}' is missing and the Parameter has no default value."); ; 230throw new DistributedApplicationException($"Connection string parameter resource could not be used because connection string '{name}' is missing."),
Publishing\ManifestPublisher.cs (2)
34throw new DistributedApplicationException( 50var 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)
62var manifestDirectory = Path.GetDirectoryName(fullyQualifiedManifestPath) ?? throw new DistributedApplicationException("Could not get directory name of output path"); 152throw new DistributedApplicationException("Project metadata not found."); 264throw new DistributedApplicationException("Could not get container image name.");
ResourceBuilderExtensions.cs (9)
554throw 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"); 714throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself."); 719throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'."); 795throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself."); 800throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'."); 851throw new DistributedApplicationException($"Resource '{builder.Resource.Name}' already has a health check with key '{key}'."); 912throw new DistributedApplicationException($"The endpoint '{endpointName}' does not exist on the resource '{builder.Resource.Name}'."); 917throw new DistributedApplicationException($"The endpoint '{endpointName}' on resource '{builder.Resource.Name}' was not using the '{desiredScheme}' scheme."); 943throw new DistributedApplicationException($"The URI for the health check is not set. Ensure that the resource has been allocated before the health check is executed.");
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (4)
18throw new DistributedApplicationException(Resources.ProjectDoesNotContainMetadataExceptionMessage); 49throw new DistributedApplicationException(message); 66throw new DistributedApplicationException(message); 92throw new DistributedApplicationException(message, ex);
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBExtensions.cs (1)
93throw 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)
197?? throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{builder.Resource.Name}' resource but the connection string was null."); 209throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource does not have any Event Hubs."); 215sp => client ?? throw new DistributedApplicationException("EventHubProducerClient is not initialized"),
Aspire.Hosting.Azure.Functions (4)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (4)
18throw new DistributedApplicationException(Resources.ProjectDoesNotContainMetadataExceptionMessage); 49throw new DistributedApplicationException(message); 66throw new DistributedApplicationException(message); 92throw new DistributedApplicationException(message, ex);
Aspire.Hosting.Azure.ServiceBus (2)
AzureServiceBusExtensions.cs (2)
310throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{builder.Resource.Name}' resource but the connection string was null."); 444() => serviceBusClient ?? throw new DistributedApplicationException($"{nameof(serviceBusClient)} was not initialized."),
Aspire.Hosting.Azure.Storage (1)
AzureStorageExtensions.cs (1)
116throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{builder.Resource.Name}' resource but the connection string was null.");
Aspire.Hosting.Dapr (1)
DaprDistributedApplicationLifecycleHook.cs (1)
46?? throw new DistributedApplicationException("Unable to locate the Dapr CLI.");
Aspire.Hosting.Elasticsearch (1)
ElasticsearchBuilderExtensions.cs (1)
66throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{elasticsearch.Name}' resource but the connection string was null.");
Aspire.Hosting.Garnet (1)
GarnetBuilderExtensions.cs (1)
71throw 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.MongoDB (2)
MongoDBBuilderExtensions.cs (2)
70throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{mongoDBContainer.Name}' resource but the connection string was null."); 121throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{mongoDBDatabase.Name}' resource but the connection string was null.");
Aspire.Hosting.MySql (1)
MySqlBuilderExtensions.cs (1)
46throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{resource.Name}' resource but the connection string was null.");
Aspire.Hosting.Nats (1)
NatsBuilderExtensions.cs (1)
64?? throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{nats.Name}' resource but the connection string was null.");
Aspire.Hosting.Oracle (1)
OracleDatabaseBuilderExtensions.cs (1)
42throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{oracleDatabaseServer.Name}' resource but the connection string was null.");
Aspire.Hosting.PostgreSQL (1)
PostgresBuilderExtensions.cs (1)
61throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{postgresServer.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)
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)
83throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{redis.Name}' resource but the connection string was null.");
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
44throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{sqlServer.Name}' resource but the connection string was null.");
Aspire.Hosting.Testing (1)
DistributedApplicationFactory.cs (1)
242throw new DistributedApplicationException(message, ex);
Aspire.Hosting.Tests (3)
DistributedApplicationTests.cs (3)
55throw new DistributedApplicationException(exceptionMessage); 96throw new DistributedApplicationException(exceptionMessage); 209throw new DistributedApplicationException(exceptionMessage);
Aspire.Hosting.Valkey (1)
ValkeyBuilderExtensions.cs (1)
71throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{valkey.Name}' resource but the connection string was null.");
Stress.AppHost (1)
ResourceBuilderExtensions.cs (1)
45?? throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as no endpoint named '{endpointName}' was found.");
74 references to DistributedApplicationException
Aspire.Hosting (15)
ApplicationModel\ResourceNotificationService.cs (1)
280/// <exception cref="DistributedApplicationException"></exception>
Dcp\DcpDependencyCheck.cs (1)
109catch (Exception ex) when (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 (3)
24/// <exception cref="DistributedApplicationException"></exception> 182catch (DistributedApplicationException ex) 220/// <exception cref="DistributedApplicationException"></exception>
Publishing\ManifestPublishingContext.cs (2)
52/// <exception cref="DistributedApplicationException">Throws when could not get the directory directory name from the output path.</exception> 249/// <exception cref="DistributedApplicationException">Thrown if the container resource does not contain a <see cref="ContainerImageAnnotation"/>.</exception>
ResourceBuilderExtensions.cs (4)
342/// <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> 537/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 585/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 605/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</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)
305Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 317Assert.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)
555Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 567Assert.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)
161Assert.Throws<DistributedApplicationException>(rabbitmq.WithManagementPlugin); 174Assert.Throws<DistributedApplicationException>(rabbitmq.WithManagementPlugin); 188Assert.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 (43)
Dcp\DcpExecutorTests.cs (1)
986var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => await appExecutor.StartResourceAsync(resourceReference, CancellationToken.None));
DistributedApplicationBuilderTests.cs (8)
133var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddResource(new ContainerResource("Test"))); 144var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddResource(new ContainerResource("TEST"))); 156var ex = Assert.Throws<DistributedApplicationException>(appBuilder.Build); 168var ex = Assert.Throws<DistributedApplicationException>(appBuilder.Build);
DistributedApplicationTests.cs (5)
59var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 100var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 214Assert.IsType<DistributedApplicationException>(ex.InnerExceptions.First());
HealthCheckTests.cs (4)
29var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 51var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () =>
ProjectResourceTests.cs (6)
23var ex = Assert.Throws<DistributedApplicationException>(() => 271var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddProject<TestProject>("projectName")); 280var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddProject<Projects.ServiceA>("projectName", launchProfileName: "not-exist"));
WaitForTests.cs (8)
46var waitForEx = Assert.Throws<DistributedApplicationException>(() => 53var waitForCompletionEx = Assert.Throws<DistributedApplicationException>(() => 68var waitForEx = Assert.Throws<DistributedApplicationException>(() => 75var waitForCompletionEx = Assert.Throws<DistributedApplicationException>(() =>
WithEndpointTests.cs (6)
159var ex = Assert.Throws<DistributedApplicationException>(() => 174var ex = Assert.Throws<DistributedApplicationException>(() => 189var ex = Assert.Throws<DistributedApplicationException>(() =>
WithEnvironmentTests.cs (2)
146var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () => await EnvironmentVariableEvaluator.GetEnvironmentVariablesAsync(
WithReferenceTests.cs (3)
137await Assert.ThrowsAsync<DistributedApplicationException>(async () => 170var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () =>