Is there an existing issue for this?
Describe the bug
After upating to 13.4.0, The callback passed to WithArgs() runs on startup even though WithExplicitStart() is specified on the service. In my case this causes a few popup from services to appear, asking for values.
Supplying a value does not actually start the service though and starting the service manually does result in the WithArgs callback being run again.
More specifically, it runs when the dashboard is opened for the first time, so right away when launching with the debugger and when opening the dashboard when just doing aspire run
Expected Behavior
Previously, the WithArgs method did not run at all until the service was started.
after updating, it runs on startup of the dashboard.
Steps To Reproduce
I have a service for adding a migration that looks like this
using Microsoft.Extensions.DependencyInjection;
#pragma warning disable ASPIREINTERACTION001
var builder = DistributedApplication.CreateBuilder(args);
builder.AddExecutable("AddMigration", "dotnet", "", "ef", "migrations", "add")
.WithExplicitStart()
.WithArgs(async context =>
{
var interactionService = context.ExecutionContext.ServiceProvider.GetRequiredService<IInteractionService>();
var name = await interactionService.PromptInputAsync("AddMigrations", "Enter Migation Name", new()
{
Name = "Migation Name",
InputType = InputType.Text,
Required = true,
Placeholder = "New migration"
});
if (name.Canceled)
throw new OperationCanceledException("Canceled");
context.Args.Add(name.Data.Value);
});
builder.Build().Run();
This used to only ask for a migration name if that service was started explicitly from the dashboard
Exceptions (if any)
No response
Aspire doctor output
Aspire Environment Check
Aspire
✅ Aspire CLI version 13.4.0 (channel: stable)
AppHost
✅ AppHost version 13.4.0 (Mma.AppHost\Mma.AppHost.csproj)
.NET SDK
✅ .NET 11.0.100-preview.4.26230.115 installed (x64)
Container Runtime
✅ Podman v5.8.2: running (configured via ASPIRE_CONTAINER_RUNTIME=podman) ← active
Environment
✅ HTTPS development certificate is trusted
Summary: 5 passed, 0 warnings, 0 failed
Aspire CLI Installations
╭──────────────────────────────────────────────┬─────────────────────────────────────────────────┬─────────┬───────────┬─────────────╮
│ Path │ Version │ Channel │ Route │ PATH status │
├──────────────────────────────────────────────┼─────────────────────────────────────────────────┼─────────┼───────────┼─────────────┤
│ C:\Users\aL.aspire\bin\aspire.exe (current) │ 13.4.0+becb48e2d61099e35ae336d527d3875e928d6594 │ stable │ (unknown) │ active │
╰──────────────────────────────────────────────┴─────────────────────────────────────────────────┴─────────┴───────────┴─────────────╯
Anything else?
No response
Is there an existing issue for this?
Describe the bug
After upating to 13.4.0, The callback passed to WithArgs() runs on startup even though WithExplicitStart() is specified on the service. In my case this causes a few popup from services to appear, asking for values.
Supplying a value does not actually start the service though and starting the service manually does result in the WithArgs callback being run again.
More specifically, it runs when the dashboard is opened for the first time, so right away when launching with the debugger and when opening the dashboard when just doing
aspire runExpected Behavior
Previously, the WithArgs method did not run at all until the service was started.
after updating, it runs on startup of the dashboard.
Steps To Reproduce
I have a service for adding a migration that looks like this
This used to only ask for a migration name if that service was started explicitly from the dashboard
Exceptions (if any)
No response
Aspire doctor output
Aspire Environment Check
Aspire
✅ Aspire CLI version 13.4.0 (channel: stable)
AppHost
✅ AppHost version 13.4.0 (Mma.AppHost\Mma.AppHost.csproj)
.NET SDK
✅ .NET 11.0.100-preview.4.26230.115 installed (x64)
Container Runtime
✅ Podman v5.8.2: running (configured via ASPIRE_CONTAINER_RUNTIME=podman) ← active
Environment
✅ HTTPS development certificate is trusted
Summary: 5 passed, 0 warnings, 0 failed
Aspire CLI Installations
╭──────────────────────────────────────────────┬─────────────────────────────────────────────────┬─────────┬───────────┬─────────────╮
│ Path │ Version │ Channel │ Route │ PATH status │
├──────────────────────────────────────────────┼─────────────────────────────────────────────────┼─────────┼───────────┼─────────────┤
│ C:\Users\aL.aspire\bin\aspire.exe (current) │ 13.4.0+becb48e2d61099e35ae336d527d3875e928d6594 │ stable │ (unknown) │ active │
╰──────────────────────────────────────────────┴─────────────────────────────────────────────────┴─────────┴───────────┴─────────────╯
Anything else?
No response