Update dotnet/aspire-integration/Aspire.Hosting.AgentFramework.DevUI/DevUIAggregatorHostedService.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Tommaso Stocchi
2026-02-10 14:07:28 +01:00
committed by GitHub
Unverified
parent aef35142c5
commit cb1b0f2645
@@ -66,8 +66,10 @@ internal sealed class DevUIAggregatorHostedService : IAsyncDisposable
});
this._app = builder.Build();
this._app.Urls.Add("http://127.0.0.1:0");
// Bind to a fixed port if one was specified on the DevUI resource; otherwise use 0 for dynamic allocation.
var port = this._resource.Port ?? 0;
this._app.Urls.Add($"http://127.0.0.1:{port}");
this.MapRoutes(this._app);
await this._app.StartAsync(cancellationToken).ConfigureAwait(false);