-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
Describe the bug
When I using dotnet run command or F5(with VS) to start the AspireHost, the migrations service can stop (The dashboard show Finished):

But when I using dotnet watch to run the AspireHost, the service still Running(Maybe stoped, but dashboard think as running):
Since other services will not start until the migration is completed, in this case, other services will never run.
The Console from terminal:
The console log from dashboard:
The code:
protected override async Task ExecuteAsync(CancellationToken cancellationToken)
{
using var activity = _activitySource.StartActivity(
"Migrating database",
ActivityKind.Client
);
try
{
using var scope = serviceProvider.CreateScope();
var dbContext = scope.ServiceProvider.GetRequiredService<DefaultDbContext>();
await RunMigrationAsync(dbContext, cancellationToken);
await SeedDataAsync(dbContext, cancellationToken);
}
catch (Exception ex)
{
activity?.AddException(ex);
throw;
}
hostApplicationLifetime.StopApplication();
}Expected Behavior
migrations service should stopped as normal when using dotnet watch.
Steps To Reproduce
using the dotnet watch to start aspire host.
Exceptions (if any)
No response
.NET Version info
.NET9 and .NET10 RC1
Anything else?
.NET Aspire 9.4.1 and .NET Aspire 9.4.2