Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated method compat
  • Loading branch information
danegsta committed Oct 30, 2025
commit 3d8b2de74bf4e2496fc6f0a5730a037e7cd7552f
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,23 @@ public static HttpClient CreateHttpClient(this DistributedApplication app, strin
return resourceWithConnectionString.GetConnectionStringAsync(cancellationToken);
}

/// <summary>
/// Gets the endpoint for the specified resource.
/// </summary>
/// <param name="app">The application.</param>
/// <param name="resourceName">The resource name.</param>
/// <param name="endpointName">The optional endpoint name. If none are specified, the single defined endpoint is returned.</param>
/// <returns>A URI representation of the endpoint.</returns>
/// <exception cref="ArgumentException">The resource was not found, no matching endpoint was found, or multiple endpoints were found.</exception>
/// <exception cref="InvalidOperationException">The resource has no endpoints.</exception>
public static Uri GetEndpoint(this DistributedApplication app, string resourceName, string? endpointName = default)
{
ArgumentNullException.ThrowIfNull(app);
ArgumentException.ThrowIfNullOrEmpty(resourceName);

return GetEndpoint(app, resourceName, endpointName, networkIdentifier: null);
}

/// <summary>
/// Gets the endpoint for the specified resource.
/// </summary>
Expand All @@ -64,7 +81,7 @@ public static HttpClient CreateHttpClient(this DistributedApplication app, strin
/// <returns>A URI representation of the endpoint.</returns>
/// <exception cref="ArgumentException">The resource was not found, no matching endpoint was found, or multiple endpoints were found.</exception>
/// <exception cref="InvalidOperationException">The resource has no endpoints.</exception>
public static Uri GetEndpoint(this DistributedApplication app, string resourceName, string? endpointName = default, NetworkIdentifier? networkIdentifier = default)
public static Uri GetEndpoint(this DistributedApplication app, string resourceName, string? endpointName = default, NetworkIdentifier? networkIdentifier)
{
ArgumentNullException.ThrowIfNull(app);
ArgumentException.ThrowIfNullOrEmpty(resourceName);
Expand Down
14 changes: 14 additions & 0 deletions src/Aspire.Hosting/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@
<Right>lib/net8.0/Aspire.Hosting.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Aspire.Hosting.ApplicationModel.ResourceExtensions.ProcessArgumentValuesAsync(Aspire.Hosting.ApplicationModel.IResource,Aspire.Hosting.DistributedApplicationExecutionContext,System.Action{System.Object,System.String,System.Exception,System.Boolean},Microsoft.Extensions.Logging.ILogger,System.String,System.Threading.CancellationToken)</Target>
<Left>lib/net8.0/Aspire.Hosting.dll</Left>
<Right>lib/net8.0/Aspire.Hosting.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Aspire.Hosting.ApplicationModel.ResourceExtensions.ProcessEnvironmentVariableValuesAsync(Aspire.Hosting.ApplicationModel.IResource,Aspire.Hosting.DistributedApplicationExecutionContext,System.Action{System.String,System.Object,System.String,System.Exception},Microsoft.Extensions.Logging.ILogger,System.String,System.Threading.CancellationToken)</Target>
<Left>lib/net8.0/Aspire.Hosting.dll</Left>
<Right>lib/net8.0/Aspire.Hosting.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Aspire.Hosting.IInteractionService.PromptInputsAsync(System.String,System.String,System.Collections.Generic.IReadOnlyList{Aspire.Hosting.InteractionInput},Aspire.Hosting.InputsDialogInteractionOptions,System.Threading.CancellationToken)</Target>
Expand Down
Loading