9 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
Aspire.Hosting.DevTunnels (2)
DevTunnelCliClient.cs (1)
604private sealed class RetryableProvisioningException(string message) : DistributedApplicationException(message);
DevTunnelNotFoundException.cs (1)
10: DistributedApplicationException($"Dev tunnel '{tunnelId}' was not found. {error}");
261 instantiations of DistributedApplicationException
Aspire.Hosting (101)
ApplicationModel\ConnectionStringReference.cs (1)
83internal void ThrowConnectionStringUnavailableException() => throw new DistributedApplicationException($"The connection string for the resource '{Resource.Name}' is not available.");
ApplicationModel\DotnetProgramPublishing.cs (2)
112throw new DistributedApplicationException( 128throw new DistributedApplicationException(
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)
255throw new DistributedApplicationException($"Stopped waiting for resource '{resourceName}' to become healthy because it does not exist in the application model."); 278throw new DistributedApplicationException($"Stopped waiting for resource '{resourceName}' to become healthy because it failed to start."); 324_ => throw new DistributedApplicationException($"Unexpected wait behavior: {waitBehavior}") 371throw new DistributedApplicationException($"Resource '{resource.Name}' stopped waiting for dependency resource '{displayName}' because it failed to start."); 383throw new DistributedApplicationException( 437throw new DistributedApplicationException($"Resource '{resource.Name}' stopped waiting for dependency resource '{displayName}' because it failed to start."); 449throw new DistributedApplicationException( 472_ => throw new DistributedApplicationException($"Unexpected wait behavior: {waitBehavior}") 587_ => throw new DistributedApplicationException($"Unexpected wait type: {waitAnnotation.WaitType}")
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
709throw new DistributedApplicationException($"Stopped waiting for resource '{target.DisplayName}' to become healthy because it failed to start.");
Dashboard\DashboardEventHandlers.cs (2)
106throw new DistributedApplicationException( 119throw new DistributedApplicationException("Dashboard path empty or file does not exist.");
Dcp\ContainerNetworkEndpointProvisioner.cs (4)
145throw 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."); 151throw 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."); 158throw 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."); 479throw new DistributedApplicationException(
Dcp\DcpDependencyCheck.cs (5)
88throw new DistributedApplicationException(string.Format( 116throw new DistributedApplicationException(string.Format( 161throw new DistributedApplicationException(string.Format( 246throw new DistributedApplicationException(detailedMessage); 262throw new DistributedApplicationException(AppendContainerRuntimeCheckError(message, error));
Dcp\DcpExecutor.cs (4)
528throw new DistributedApplicationException($"One or more container volumes did not become ready: {details}"); 1121throw new DistributedApplicationException($"Couldn't find required {nameof(DcpInstancesAnnotation)} annotation on resource {resource.Name}."); 1132throw new DistributedApplicationException($"Couldn't find required instance ID for index {instanceIndex} on resource {resource.Name}."); 1370throw new DistributedApplicationException($"Failed to delete '{resource.DcpResourceName}' successfully before restart.");
Dcp\ExecutableCreator.cs (1)
317throw new DistributedApplicationException($"Couldn't find required {nameof(DcpInstancesAnnotation)} annotation on resource {resource.Name}.");
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)
157_ => throw new DistributedApplicationException("Invalid operation specified. Valid operations are 'publish', 'run', or 'inspect'.") 888throw 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 (1)
404throw new DistributedApplicationException(
ProjectResourceBuilderExtensions.cs (2)
434throw new DistributedApplicationException(message); 547throw new DistributedApplicationException($"File-based apps are only supported on .NET 10 or later. The version active in '{projectDirectory}' is {version}.");
Publishing\ContainerImageArchiveRewriter.cs (9)
106throw new DistributedApplicationException( 112throw new DistributedApplicationException( 133throw new DistributedApplicationException( 139throw new DistributedApplicationException( 214throw new DistributedApplicationException("The container image archive is empty."); 527throw new DistributedApplicationException( 533throw new DistributedApplicationException( 587throw new DistributedApplicationException( 596return new DistributedApplicationException(
Publishing\ContainerRuntimeBase.cs (6)
369throw new DistributedApplicationException(message); 415throw new DistributedApplicationException(message); 601throw new DistributedApplicationException($"{Name} {operationName} for '{imageName}' failed with exit code {processResult.ExitCode}.{Environment.NewLine}{processResult.GetFormattedOutput()}"); 695throw new DistributedApplicationException(message); 744throw new DistributedApplicationException( 919throw new DistributedApplicationException(
Publishing\ContainerRuntimeReadiness.cs (1)
78throw new DistributedApplicationException(
Publishing\DockerContainerRuntime.cs (3)
162throw new DistributedApplicationException(LocalImageOciArchiveNotSupportedMessage); 177throw new DistributedApplicationException( 209throw new DistributedApplicationException("Docker did not report exactly one active context.");
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 (4)
72var manifestDirectory = Path.GetDirectoryName(fullyQualifiedManifestPath) ?? throw new DistributedApplicationException("Could not get directory name of output path"); 134await WriteResourceObjectAsync(resource, () => throw new DistributedApplicationException( 187throw new DistributedApplicationException($"Project metadata was not found for resource '{project.Name}'."); 337throw 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 (2)
749throw new DistributedApplicationException( 777throw new DistributedApplicationException(
ResourceBuilderExtensions.cs (27)
448throw 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}"); 1195throw new DistributedApplicationException( 1414throw 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}"); 2557throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself."); 2562throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'."); 2680throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself."); 2685throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'."); 2783throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for itself."); 2788throw new DistributedApplicationException($"The '{builder.Resource.Name}' resource cannot wait for its parent '{dependency.Resource.Name}'."); 2843throw new DistributedApplicationException($"Resource '{builder.Resource.Name}' already has a health check with key '{key}'."); 2930?? throw new DistributedApplicationException($"Could not create HTTP health check for resource '{builder.Resource.Name}' as the endpoint selector returned null."); 2934throw 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."); 2947throw new DistributedApplicationException($"The endpoint '{endpointName}' does not exist on the resource '{builder.Resource.Name}'."); 3452throw new DistributedApplicationException("Process command output line count must be greater than zero."); 3492throw new DistributedApplicationException("Process command requires a non-empty executable path."); 3500throw new DistributedApplicationException("Process command arguments cannot contain null values."); 3527throw new DistributedApplicationException("Process command environment variables require non-empty names."); 3532throw new DistributedApplicationException($"Process command environment variable '{name}' requires a value."); 3548throw new DistributedApplicationException($"Process command '{processCommandSpec.ExecutablePath}' arguments cannot contain null values."); 3557throw new DistributedApplicationException($"Process command '{processCommandSpec.ExecutablePath}' environment variables require non-empty names."); 3562throw new DistributedApplicationException($"Process command '{processCommandSpec.ExecutablePath}' environment variable '{name}' requires a value."); 3805?? throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as the endpoint selector returned null."); 3809throw 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."); 4503throw 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."); 4511throw new DistributedApplicationException($"Could not create {errorDisplayNoun} for resource '{builder.Resource.Name}' as no endpoint was found matching one of the specified names: {endpointNamesString}"); 4531throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as it has no HTTP endpoints."); 5241var 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)
309throw 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.Sandboxes (1)
src\Shared\CrossScopeAcrPullIdentityPreparer.cs (1)
122throw new DistributedApplicationException(
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)
319? new DistributedApplicationException(message, result.StartException) 320: new DistributedApplicationException(message); 330throw new DistributedApplicationException( 337throw new DistributedApplicationException( 362throw new DistributedApplicationException(
Aspire.Hosting.DevTunnels (14)
DevTunnelCliClient.cs (12)
64throw new DistributedApplicationException($"Failed to get devtunnel CLI version. Output: '{output}'. Error: '{error}'"); 141throw new DistributedApplicationException( 192throw new DistributedApplicationException($"Failed to create dev tunnel '{tunnelId}' after {attempts} attempts. Exit code {exitCode}: {error}"); 210return tunnel ?? throw new DistributedApplicationException($"Failed to get dev tunnel '{tunnelId}'. Exit code {exitCode}: {error}"); 219return ports ?? throw new DistributedApplicationException($"Failed to get port list for dev tunnel '{tunnelId}'. Exit code {exitCode}: {error}"); 300throw new DistributedApplicationException($"Failed to create port '{portNumber}' for tunnel '{tunnelId}' after {attempts} attempts. Exit code {exitCode}: {error}"); 351throw new DistributedApplicationException($"Failed to inspect {description}. Exit code {exitCode}: {error}"); 372throw new DistributedApplicationException($"The devtunnel CLI returned tunnel '{returnedId}' when '{requestedId}' was requested."); 380throw new DistributedApplicationException($"The devtunnel CLI returned port '{port.PortNumber}' when port '{portNumber}' on tunnel '{tunnelId}' was requested."); 510return login ?? throw new DistributedApplicationException($"Failed to get user login status. Exit code {exitCode}: {error}"); 529throw new DistributedApplicationException($"Failed to perform user login. Process finished with exit code: {exitCode}"); 598throw new DistributedApplicationException($"Failed to parse JSON output into type '{typeof(T).Name}':\n{output}", ex);
DevTunnelResourceBuilderExtensions.cs (2)
136throw new DistributedApplicationException(result.ValidationMessage); 157var 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)
DevTunnelMonitorTests.cs (2)
584throw new DistributedApplicationException("Access query failed."); 635test.Client.GetAccessCallback = (_, _) => throw new DistributedApplicationException("Access query failed.");
Aspire.Hosting.Dotnet (14)
DotnetProjectBuildCoordinator.cs (4)
196throw new DistributedApplicationException( 667throw new DistributedApplicationException( 813throw new DistributedApplicationException( 1197throw new DistributedApplicationException(
DotnetProjectHostingExtensions.cs (2)
172throw new DistributedApplicationException( 451throw new DistributedApplicationException(message);
DotnetProjectRunPropertiesResolver.cs (4)
79throw new DistributedApplicationException( 120throw new DistributedApplicationException( 141throw new DistributedApplicationException( 149throw 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.EntityFrameworkCore.Tests (2)
EFBuildReadinessTests.cs (2)
76completion.SetException(new DistributedApplicationException("coordinated build failed")); 135: Task.FromException(new DistributedApplicationException("build failed"));
Aspire.Hosting.Foundry (4)
HostedAgent\AzureHostedAgentResource.cs (1)
429throw 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( 1009throw new DistributedApplicationException( 1045throw new DistributedApplicationException( 1056throw new DistributedApplicationException( 1062throw new DistributedApplicationException( 1081throw new DistributedApplicationException( 1097throw new DistributedApplicationException( 1154?? throw new DistributedApplicationException( 1177throw new DistributedApplicationException(
JavaHostingExtensions.cs (4)
135throw new DistributedApplicationException( 1254throw new DistributedApplicationException( 1537throw new DistributedApplicationException( 1545throw new DistributedApplicationException(
Aspire.Hosting.JavaScript (1)
JavaScriptHostingExtensions.cs (1)
1982throw new DistributedApplicationException(
Aspire.Hosting.Kafka (1)
KafkaBuilderExtensions.cs (1)
50throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{kafka.Name}' resource but the connection string was null.");
Aspire.Hosting.Kubernetes (4)
KubernetesEnvironmentExtensions.cs (4)
118throw new DistributedApplicationException( 151throw new DistributedApplicationException( 189throw new DistributedApplicationException( 244throw new DistributedApplicationException(
Aspire.Hosting.Maui (9)
MauiiOSExtensions.cs (2)
228throw new DistributedApplicationException( 430throw new DistributedApplicationException(
MauiOtlpExtensions.cs (6)
142var exception = 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."); 179var exception = new DistributedApplicationException($"The Aspire dashboard resource '{KnownResourceNames.AspireDashboard}' terminated or does not have a concrete OTLP endpoint named '{KnownEndpointNames.OtlpHttpEndpointName}' or '{KnownEndpointNames.OtlpGrpcEndpointName}', 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."); 252throw new DistributedApplicationException($"The configured OTLP endpoint URL '{url}' from '{configKey}' must be an absolute locally reachable HTTP or HTTPS URL with a port between 1 and 65535."); 435throw new DistributedApplicationException( 591throw new DistributedApplicationException( 615throw new DistributedApplicationException(
MauiPlatformHelper.cs (1)
151throw new DistributedApplicationException(
Aspire.Hosting.MongoDB (11)
MongoDBBuilderExtensions.cs (4)
104?? throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{resource.Name}' resource but the connection string was null."); 210?? throw new DistributedApplicationException("The MongoDB REPL port is not available."); 218throw new DistributedApplicationException("The MongoDB REPL credentials are not available."); 281throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{mongoDBDatabase.Name}' resource but the connection string was null.");
MongoDBSingleMemberReplicaSet.cs (2)
57?? throw new DistributedApplicationException($"The connection string for MongoDB resource '{resource.Name}' is unavailable."); 149throw new DistributedApplicationException($"The existing MongoDB replica set configuration does not match single-member set '{name}' at '{host}'. Use its original configuration and data volume; automatic migration or reconfiguration is not supported.");
ReplicaSet\MongoDBReplicaSetBuilderExtensions.cs (5)
144throw new DistributedApplicationException($"MongoDB replica set member '{memberWithoutTls.Name}' does not have TLS enabled, which is required for members of a replica set. Ensure an HTTPS/TLS certificate is available for the member, for example by trusting the ASP.NET Core developer certificate."); 150?? throw new DistributedApplicationException($"The connection string of MongoDB replica set member '{member.Name}' could not be resolved.") 162.ConfigureAwait(false) ?? throw new DistributedApplicationException($"The endpoint of MongoDB replica set member '{m.Name}' could not be resolved.") 239throw new DistributedApplicationException($"Cannot remove {string.Join(", ", removedHosts.Select(h => $"'{h}'"))} from the existing MongoDB replica set '{rsResource.Name}': removing members from a replica set that has already been initialized is not supported yet. Add the member(s) back, or start over from an empty replica set by removing the data volumes of its members."); 353throw new DistributedApplicationException(
Aspire.Hosting.MySql (5)
MySqlBuilderExtensions.cs (5)
56throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{resource.Name}' resource but the connection string was null."); 64throw new DistributedApplicationException($"ResourceReadyEvent was published for the '{resource.Name}' resource but the connection string was null."); 122var port = resource.PrimaryEndpoint.TargetPort ?? throw new DistributedApplicationException("The MySQL REPL port is not available."); 126throw new DistributedApplicationException("The MySQL REPL password is not available."); 186throw 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 (5)
PostgresBuilderExtensions.cs (5)
72throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{postgresServer.Name}' resource but the connection string was null."); 80throw new DistributedApplicationException($"ResourceReadyEvent was published for the '{postgresServer.Name}' resource but the connection string was null."); 155var port = resource.PrimaryEndpoint.TargetPort ?? throw new DistributedApplicationException("The PostgreSQL REPL port is not available."); 160throw new DistributedApplicationException("The PostgreSQL REPL credentials are not available."); 214throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{name}' resource but the connection string was null.");
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
59?? 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."); 238throw 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 (3)
RedisBuilderExtensions.cs (3)
90throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{redis.Name}' resource but the connection string was null."); 245var port = endpoint.TargetPort ?? throw new DistributedApplicationException("The Redis REPL port is not available."); 258throw new DistributedApplicationException("The Redis REPL password is not available.");
Aspire.Hosting.RemoteHost.Tests (1)
CapabilityDispatcherTests.cs (1)
2250throw 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 (5)
SqlServerBuilderExtensions.cs (5)
73throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{sqlServer.Name}' resource but the connection string was null."); 82throw new DistributedApplicationException($"ResourceReadyEvent was published for the '{sqlServer.Name}' resource but the connection string was null."); 185throw new DistributedApplicationException("The SQL Server REPL password is not available."); 188var port = resource.PrimaryEndpoint.TargetPort ?? throw new DistributedApplicationException("The SQL Server REPL port is not available."); 254throw 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); 706throw new DistributedApplicationException(exceptionMessage);
Aspire.Hosting.TestUtilities (2)
Publishing\FakeContainerRuntime.cs (2)
169throw new DistributedApplicationException("Fake container runtime is configured to fail"); 180throw new DistributedApplicationException("Fake container runtime is configured to fail");
Aspire.Hosting.Valkey (3)
ValkeyBuilderExtensions.cs (3)
138throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{valkey.Name}' resource but the connection string was null."); 216var port = resource.PrimaryEndpoint.TargetPort ?? throw new DistributedApplicationException("The Valkey REPL port is not available."); 229throw new DistributedApplicationException("The Valkey REPL password is not available.");
Aspire.Hosting.Yarp (1)
YarpJsonConfigGeneratorBuilder.cs (1)
70throw new DistributedApplicationException($"Error when reading the YARP config file '{_configFilePath}'", ex);
390 references to DistributedApplicationException
Aspire.Hosting (32)
ApplicationModel\ResourceNotificationService.cs (2)
238/// will throw a <see cref="DistributedApplicationException"/> if the resource enters an 504/// <exception cref="DistributedApplicationException"></exception>
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
692catch (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)
1098catch (DistributedApplicationException)
Publishing\ContainerImageArchiveRewriter.cs (2)
127catch (DistributedApplicationException) 594private static DistributedApplicationException InvalidMetadata(string entryName, string reason)
Publishing\ContainerRuntimeBase.cs (3)
119catch (DistributedApplicationException ex) 157catch (DistributedApplicationException ex) 925catch (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)
62/// <exception cref="DistributedApplicationException">Throws when could not get the directory directory name from the output path.</exception> 322/// <exception cref="DistributedApplicationException">Thrown if the container resource does not contain a <see cref="ContainerImageAnnotation"/>.</exception>
Publishing\PodmanContainerRuntime.cs (2)
331catch (DistributedApplicationException ex) 379catch (DistributedApplicationException ex)
ResourceBuilderExtensions.cs (8)
1110/// <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> 1621/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 1695/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 1780/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 1805/// <exception cref="DistributedApplicationException">Throws an exception if an endpoint with the same name already exists on the specified resource.</exception> 2532/// will throw a <see cref="DistributedApplicationException"/> if the resource enters an unavailable state.</para> 2655/// will throw a <see cref="DistributedApplicationException"/> if the resource enters an unavailable state.</para> 3744/// <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)
2099var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => app.RunAsync()); 2276var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => app.RunAsync()); 2305var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => app.RunAsync()); 2334var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => app.RunAsync());
Aspire.Hosting.Blazor.Tests (2)
BlazorHostedExtensionsTests.cs (2)
351var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
157var exception = new DistributedApplicationException($"Error trying to create the dev tunnel resource '{tunnelResource.TunnelId}' this port belongs to: {ex.Message}", ex);
Aspire.Hosting.DevTunnels.Tests (13)
DevTunnelCliClientTests.cs (13)
156await Assert.ThrowsAnyAsync<DistributedApplicationException>(() => CreateClient(cli).CreateTunnelAsync("mytunnel", new() { Description = "new" })); 198await Assert.ThrowsAsync<DistributedApplicationException>(() => CreateClient(cli).CreateTunnelAsync("mytunnel", new())); 213await Assert.ThrowsAsync<DistributedApplicationException>(() => CreateClient(cli).CreateTunnelAsync(requested, new() { AllowAnonymous = true })); 238await Assert.ThrowsAsync<DistributedApplicationException>(() => 249await Assert.ThrowsAsync<DistributedApplicationException>(() => 260await Assert.ThrowsAsync<DistributedApplicationException>(() => CreateClient(cli).CreateTunnelAsync("mytunnel", new())); 270await Assert.ThrowsAsync<DistributedApplicationException>(() => 280await Assert.ThrowsAsync<DistributedApplicationException>(() => CreateClient(cli).GetTunnelAsync("mytunnel.usw2")); 313await Assert.ThrowsAsync<DistributedApplicationException>(() => 325await Assert.ThrowsAsync<DistributedApplicationException>(() => CreateClient(cli).CreateTunnelAsync("mytunnel", new())); 525await Assert.ThrowsAnyAsync<DistributedApplicationException>(provision); 605var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
Aspire.Hosting.Dotnet (4)
DotnetProjectHostingExtensions.cs (3)
33/// <exception cref="DistributedApplicationException"> 89/// <exception cref="DistributedApplicationException"> 132/// <exception cref="DistributedApplicationException">
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 (32)
DotnetProjectBuildCoordinatorTests.cs (21)
1323var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 1352var rebuildException = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 1544var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 1565var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 2523var firstException = await Assert.ThrowsAsync<DistributedApplicationException>( 2525var secondException = await Assert.ThrowsAsync<DistributedApplicationException>( 2554await Assert.ThrowsAsync<DistributedApplicationException>( 2592var firstException = await Assert.ThrowsAsync<DistributedApplicationException>( 2594var secondException = await Assert.ThrowsAsync<DistributedApplicationException>( 3311await Assert.ThrowsAsync<DistributedApplicationException>(() => wait); 3409await Assert.ThrowsAsync<DistributedApplicationException>(() => wait); 3432await Assert.ThrowsAsync<DistributedApplicationException>(() => PublishBeforeStartAsync(builder, app)); 3433await Assert.ThrowsAsync<DistributedApplicationException>(() => wait);
DotnetProjectPublicApiTests.cs (6)
120var valueException = Assert.Throws<DistributedApplicationException>( 122var callbackException = Assert.Throws<DistributedApplicationException>( 124var asyncCallbackException = Assert.Throws<DistributedApplicationException>(
DotnetProjectResourceTests.cs (4)
214var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 437var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
DotnetProjectRunPropertiesResolverTests.cs (1)
31await Assert.ThrowsAsync<DistributedApplicationException>(() =>
Aspire.Hosting.EntityFrameworkCore.Tests (2)
EFBuildReadinessTests.cs (2)
80await Assert.ThrowsAsync<DistributedApplicationException>( 112await Assert.ThrowsAsync<DistributedApplicationException>(
Aspire.Hosting.Foundry.Tests (8)
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"));
HostedAgentExtensionTests.cs (2)
664var exception = Assert.Throws<DistributedApplicationException>(
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> 983/// <exception cref="DistributedApplicationException">The properties file is missing.</exception> 1033/// <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>( 300var exception = Assert.Throws<DistributedApplicationException>( 451var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 1173var exception = Assert.Throws<DistributedApplicationException>( 1261var ex = Assert.Throws<DistributedApplicationException>( 1282var ex = Assert.Throws<DistributedApplicationException>( 1305var ex = Assert.Throws<DistributedApplicationException>( 1328var ex = Assert.Throws<DistributedApplicationException>( 1413var ex = Assert.Throws<DistributedApplicationException>( 1440var ex = Assert.Throws<DistributedApplicationException>( 2007var exception = Assert.Throws<DistributedApplicationException>( 2024var exception = Assert.Throws<DistributedApplicationException>( 2142var ex = Assert.Throws<DistributedApplicationException>( 2291var exception = Assert.Throws<DistributedApplicationException>( 2312var exception = Assert.Throws<DistributedApplicationException>( 2329var exception = Assert.Throws<DistributedApplicationException>( 2344var exception = Assert.Throws<DistributedApplicationException>( 2392var 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.Kubernetes.Tests (14)
KubernetesEnvironmentResourceTests.cs (2)
212var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
KubernetesPersistentVolumeRunModeTests.cs (10)
128var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 151var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 364var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 420var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 473var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
KubernetesPublisherTests.cs (2)
2180var ex = await Assert.ThrowsAsync<DistributedApplicationException>(() => app.RunAsync());
Aspire.Hosting.Maui (3)
MauiOtlpExtensions.cs (3)
142var exception = 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."); 167catch (DistributedApplicationException exception) 179var exception = new DistributedApplicationException($"The Aspire dashboard resource '{KnownResourceNames.AspireDashboard}' terminated or does not have a concrete OTLP endpoint named '{KnownEndpointNames.OtlpHttpEndpointName}' or '{KnownEndpointNames.OtlpGrpcEndpointName}', 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.");
Aspire.Hosting.Maui.Tests (22)
MauiiOSValidationTests.cs (4)
33var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 59var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () =>
MauiPlatformExtensionsTests.cs (18)
150var exception = Assert.Throws<DistributedApplicationException>(() => 294var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 1119var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => 1145var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => 1174var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => 1225var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => 1294Assert.All(exception.InnerExceptions, innerException => Assert.IsType<DistributedApplicationException>(innerException)); 1352var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 1377var exception = Assert.Throws<DistributedApplicationException>(() => androidEmulator.WithOtlpDevTunnel()); 1387DistributedApplicationException expectedException)
Aspire.Hosting.MongoDB (1)
MongoDBSingleMemberReplicaSet.cs (1)
76catch (Exception ex) when (ex is MongoException or TimeoutException or DistributedApplicationException)
Aspire.Hosting.MongoDB.Tests (6)
AddMongoDBTests.cs (2)
338Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 350Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
MongoDBReplCommandTests.cs (2)
97var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() =>
SingleMemberReplicaSetTests.cs (2)
185var exception = Assert.Throws<DistributedApplicationException>(() =>
Aspire.Hosting.MySql.Tests (4)
AddMySqlTests.cs (2)
315Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 327Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
MySqlReplCommandTests.cs (2)
68var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() =>
Aspire.Hosting.Oracle.Tests (2)
AddOracleTests.cs (2)
269Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 281Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
Aspire.Hosting.PostgreSQL.Tests (4)
AddPostgresTests.cs (2)
622Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 634Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db"));
PostgresReplCommandTests.cs (2)
69var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() =>
Aspire.Hosting.Qdrant.Tests (2)
AddQdrantTests.cs (2)
301var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () =>
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)
206Assert.Throws<DistributedApplicationException>(() => db.AddDatabase("db")); 218Assert.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 (129)
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>(
Dashboard\DashboardEventHandlersTests.cs (2)
920var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
Dcp\DcpDependencyCheckTests.cs (6)
30var exception = Assert.Throws<DistributedApplicationException>( 60var exception = Assert.Throws<DistributedApplicationException>( 92var exception = Assert.Throws<DistributedApplicationException>(
Dcp\DcpExecutorTests.cs (10)
820var ex = await Assert.ThrowsAsync<DistributedApplicationException>(() => appExecutor.RunApplicationAsync()); 842var ex = await Assert.ThrowsAsync<DistributedApplicationException>(() => appExecutor.RunApplicationAsync()); 864var ex = await Assert.ThrowsAsync<DistributedApplicationException>(() => appExecutor.RunApplicationAsync()); 4864var ex = await Assert.ThrowsAsync<DistributedApplicationException>(async () => await appExecutor.StartResourceAsync(resourceReference, CancellationToken.None)); 11359var exception = Assert.Throws<DistributedApplicationException>(
DistributedApplicationBuilderTests.cs (4)
420var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddResource(new ContainerResource("Test"))); 431var 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 () => 712Assert.IsType<DistributedApplicationException>(ex.InnerExceptions.First());
DotnetProgramPublishingTests.cs (8)
272var pipelineException = await Assert.ThrowsAsync<DistributedApplicationException>( 276var directException = await Assert.ThrowsAsync<DistributedApplicationException>( 278var batchException = await Assert.ThrowsAsync<DistributedApplicationException>( 345var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
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 (8)
83var ex = Assert.Throws<DistributedApplicationException>(() => 348var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddProject<TestProject>("projectName")); 358var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddProject<Projects.ServiceA>("projectName", launchProfileName: "not-exist")); 1052var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
PublishAsDockerfileTests.cs (4)
497var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => ManifestUtils.GetManifest(project)); 507var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => ManifestUtils.GetManifest(container));
Publishing\ContainerImageArchiveRewriterTests.cs (8)
294var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => 315var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => 340var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => 373var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() =>
Publishing\ContainerRuntimeBaseTests.cs (2)
21var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() =>
Publishing\ContainerRuntimeReadinessTests.cs (7)
36var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => 90var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => check).DefaultTimeout(); 113await Assert.ThrowsAsync<DistributedApplicationException>(() => 169var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => check).DefaultTimeout();
Publishing\DockerContainerRuntimeTests.cs (6)
312var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 338var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 366var exception = await Assert.ThrowsAsync<DistributedApplicationException>(
Publishing\DotnetProgramArchiveTests.cs (1)
267await Assert.ThrowsAsync<DistributedApplicationException>(
Publishing\ResourceContainerImageManagerTests.cs (3)
816var exception = await Assert.ThrowsAsync<DistributedApplicationException>( 1956catch (DistributedApplicationException)
ResourceNotificationTests.cs (3)
1661await Assert.ThrowsAsync<DistributedApplicationException>( 1676var 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 (10)
308var inner = Assert.IsType<DistributedApplicationException>(aggregate.InnerException); 865var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 928var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 954var exception = await Assert.ThrowsAsync<DistributedApplicationException>(async () => 1062var inner = Assert.IsType<DistributedApplicationException>(aggregate.InnerException);