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
59 instantiations of DistributedApplicationException
Aspire.Hosting (30)
ApplicationModel\ConnectionStringReference.cs (1)
35throw new DistributedApplicationException($"The connection string for the resource '{Resource.Name}' is not available.");
Dashboard\DashboardLifecycleHook.cs (1)
81throw new DistributedApplicationException("Dashboard path empty or file does not exist.");
Dcp\DcpDependencyCheck.cs (5)
89throw new DistributedApplicationException(string.Format( 116throw new DistributedApplicationException(string.Format( 165throw new DistributedApplicationException(string.Format( 205throw new DistributedApplicationException(string.Format( 214throw new DistributedApplicationException(string.Format(
Dcp\HostDashboardEndpointProvider.cs (1)
25throw new DistributedApplicationException("Error getting the resource service URL.", ex);
DistributedApplicationBuilder.cs (2)
330throw new DistributedApplicationException($"Multiple resources with the name '{duplicateResourceName}'. Resource names are case-insensitive."); 353throw 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.");
LaunchProfileExtensions.cs (4)
18throw new DistributedApplicationException(Resources.ProjectDoesNotContainMetadataExceptionMessage); 49throw new DistributedApplicationException(message); 66throw new DistributedApplicationException(message); 92throw new DistributedApplicationException(message, ex);
ParameterResourceBuilderExtensions.cs (2)
82?? throw new DistributedApplicationException($"Parameter resource could not be used because configuration key '{configurationKey}' is missing and the Parameter has no default value."); ; 154return builder.Configuration.GetConnectionString(name) ?? throw 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 (5)
61var manifestDirectory = Path.GetDirectoryName(fullyQualifiedManifestPath) ?? throw new DistributedApplicationException("Could not get directory name of output path"); 153throw new DistributedApplicationException("Project metadata not found."); 238throw new DistributedApplicationException("Could not get container image name."); 463_ => throw new DistributedApplicationException($"The value of the environment variable '{key}' is not supported.") 504_ => throw new DistributedApplicationException($"The value of the argument '{arg}' is not supported.")
ResourceBuilderExtensions.cs (7)
457throw 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"); 618throw new DistributedApplicationException($"Dependency resource '{dependency.Resource.Name}' failed to start."); 628throw new DistributedApplicationException( 683throw new DistributedApplicationException("WaitForCompletion cannot be used with resources that have replicas."); 702throw new DistributedApplicationException($"Dependency resource '{dependency.Resource.Name}' failed to start."); 713throw new DistributedApplicationException( 766throw new DistributedApplicationException($"Resource '{builder.Resource.Name}' already has a health check with key '{key}'.");
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBExtensions.cs (1)
118throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{resource.Name}' resource but the connection string was null.");
Aspire.Hosting.Dapr (1)
DaprDistributedApplicationLifecycleHook.cs (1)
45?? 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)
68throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{garnet.Name}' resource but the connection string was null.");
Aspire.Hosting.Kafka (1)
KafkaBuilderExtensions.cs (1)
45throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{kafka.Name}' resource but the connection string was null.");
Aspire.Hosting.Milvus (3)
MilvusBuilderExtensions.cs (3)
68throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{milvus.Name}' resource but the connection string was null."); 76throw new DistributedApplicationException($"Database resource '{databaseName}' under Milvus Server resource '{milvus.Name}' was not found in the model."); 157throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{milvusDatabaseResource.Name}' resource but the connection string was null.");
Aspire.Hosting.MongoDB (1)
MongoDBBuilderExtensions.cs (1)
41throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{mongoDBContainer.Name}' resource but the connection string was null.");
Aspire.Hosting.MySql (3)
MySqlBuilderExtensions.cs (3)
43throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{resource.Name}' resource but the connection string was null."); 52throw new DistributedApplicationException($"Database resource '{databaseName}' under MySql resource '{resource.Name}' was not found in the model."); 103throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{mySqlDatabase.Name}' resource but the connection string was null.");
Aspire.Hosting.Oracle (3)
OracleDatabaseBuilderExtensions.cs (3)
39throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{oracleDatabaseServer.Name}' resource but the connection string was null."); 48throw new DistributedApplicationException($"Database resource '{databaseName}' under Oracle resource '{oracleDatabaseServer.Name}' was not found in the model."); 97throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{oracleDatabase.Name}' resource but the connection string was null.");
Aspire.Hosting.PostgreSQL (3)
PostgresBuilderExtensions.cs (3)
59throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{postgresServer.Name}' resource but the connection string was null."); 68throw new DistributedApplicationException($"Database resource '{databaseName}' under Postgres server resource '{postgresServer.Name}' not in model."); 144throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{postgresDatabase}' resource but the connection string was null.");
Aspire.Hosting.RabbitMQ (2)
RabbitMQBuilderExtensions.cs (2)
50throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{rabbitMq.Name}' resource but the connection string was null."); 190throw 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)
53throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{redis.Name}' resource but the connection string was null.");
Aspire.Hosting.SqlServer (3)
SqlServerBuilderExtensions.cs (3)
41throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{sqlServer.Name}' resource but the connection string was null."); 50throw new DistributedApplicationException($"Database resource '{databaseName}' under SQL Server resource '{sqlServer.Name}' was not found in the model."); 102throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{sqlServerDatabase}' resource but the connection string was null.");
Aspire.Hosting.Testing (1)
DistributedApplicationFactory.cs (1)
223throw new DistributedApplicationException(message, ex);
Aspire.Hosting.Tests (3)
DistributedApplicationTests.cs (3)
50throw new DistributedApplicationException(exceptionMessage); 91throw new DistributedApplicationException(exceptionMessage); 119throw new DistributedApplicationException(exceptionMessage);
Aspire.Hosting.Valkey (1)
ValkeyBuilderExtensions.cs (1)
66throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{valkey.Name}' resource but the connection string was null.");
60 references to DistributedApplicationException
Aspire.Hosting (14)
Dcp\DcpDependencyCheck.cs (1)
114catch (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> 111catch (DistributedApplicationException ex) 149/// <exception cref="DistributedApplicationException"></exception>
Publishing\ManifestPublishingContext.cs (2)
51/// <exception cref="DistributedApplicationException">Throws when could not get the directory directory name from the output path.</exception> 224/// <exception cref="DistributedApplicationException">Thrown if the container resource does not contain a <see cref="ContainerImageAnnotation"/>.</exception>
ResourceBuilderExtensions.cs (4)
287/// <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> 442/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 488/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 506/// <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)
218Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 230Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
306Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 318Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
Aspire.Hosting.Oracle.Tests (2)
AddOracleTests.cs (2)
272Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 284Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
Aspire.Hosting.PostgreSQL.Tests (2)
AddPostgresTests.cs (2)
556Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 568Assert.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)
113/// Calling this method on a resource configured with an unrecognized image registry, name, or tag will result in a <see cref="DistributedApplicationException"/> being thrown. 117/// <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)
162Assert.Throws<DistributedApplicationException>(rabbitmq.WithManagementPlugin); 176Assert.Throws<DistributedApplicationException>(rabbitmq.WithManagementPlugin); 190Assert.Throws<DistributedApplicationException>(rabbitmq.WithManagementPlugin);
Aspire.Hosting.SqlServer.Tests (2)
AddSqlServerTests.cs (2)
205Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 217Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
Aspire.Hosting.Tests (30)
DistributedApplicationBuilderTests.cs (8)
105var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddResource(new ContainerResource("Test"))); 116var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddResource(new ContainerResource("TEST"))); 128var ex = Assert.Throws<DistributedApplicationException>(appBuilder.Build); 140var ex = Assert.Throws<DistributedApplicationException>(appBuilder.Build);
DistributedApplicationTests.cs (5)
54var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 95var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 124Assert.IsType<DistributedApplicationException>(ex.InnerExceptions.First());
ProjectResourceTests.cs (6)
22var ex = Assert.Throws<DistributedApplicationException>(() => 270var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddProject<TestProject>("projectName")); 279var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddProject<Projects.ServiceA>("projectName", launchProfileName: "not-exist"));
WithEndpointTests.cs (6)
158var ex = Assert.Throws<DistributedApplicationException>(() => 173var ex = Assert.Throws<DistributedApplicationException>(() => 188var ex = Assert.Throws<DistributedApplicationException>(() =>
WithEnvironmentTests.cs (2)
145var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () => await EnvironmentVariableEvaluator.GetEnvironmentVariablesAsync(
WithReferenceTests.cs (3)
136await Assert.ThrowsAsync<DistributedApplicationException>(async () => 169var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () =>