Is there an existing issue for this?
Describe the bug
The BeforeResourceStartedEvent event only gets fired the FIRST time a resource is started, and not on subsequent starts.
Expected Behavior
When restarting an application in the dashboard, the BeforeResourceStartedEvent should get fired twice (+ additional times if you restart the application more than once)
Steps To Reproduce
- Have the below app
- In the aspire dashboard, stop the
one resource
- In the aspire dashboard, start the
one resource
var one = builder.AddContainer("one", "nginx");
builder.Eventing.Subscribe<BeforeResourceStartedEvent>(one.Resource, (evt, ct) =>
{
Console.WriteLine("BeforeResourceStartedEvent");
Console.Beep();
return Task.CompletedTask;
});
Exceptions (if any)
No response
.NET Version info
.NET SDK:
Version: 9.0.100
Commit: 59db016f11
Workload version: 9.0.100-manifests.b7b342be
MSBuild version: 17.12.7+5b8665660
Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.100\
.NET workloads installed:
[aspire]
Installation Source: VS 17.12.35506.116
Manifest Version: 9.0.0-preview.4.24454.4/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\9.0.0-preview.4.24454.4\WorkloadManifest.json
Install Type: Msi
Configured to use loose manifests when installing new manifests.
Host:
Version: 9.0.0
Architecture: x64
Commit: 9d5a6a9aa4
.NET SDKs installed:
8.0.404 [C:\Program Files\dotnet\sdk]
9.0.100-rc.2.24474.11 [C:\Program Files\dotnet\sdk]
9.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0-rc.2.24474.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0-rc.2.24473.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0-rc.2.24474.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Anything else?
<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0" />
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.0.0" />
Is there an existing issue for this?
Describe the bug
The
BeforeResourceStartedEventevent only gets fired the FIRST time a resource is started, and not on subsequent starts.Expected Behavior
When restarting an application in the dashboard, the
BeforeResourceStartedEventshould get fired twice (+ additional times if you restart the application more than once)Steps To Reproduce
oneresourceoneresourceExceptions (if any)
No response
.NET Version info
Anything else?