dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.8k stars 450 forks source link

[AzureTools][Aspire][Unstable] The "Stop" button doesn't switch to "Start" after clicking "Stop" button for Console App C# project #6311

Open amnabatr1sha opened 1 week ago

amnabatr1sha commented 1 week ago

REGRESSION INFO: Not repro on Aspire 8.2.1 and Aspire 8.2.0

Clean machine: Win11 x64 23h2 ENU VS Version: VS 17.12 Preview 3.0 [35410.144.d17.12] Aspire Version: 9.0.0-rc.1.24509.13 Apply NuGet Feeds

Repro Steps:

  1. Create a new 8.0/9.0 Console App C# project -> Right click on the project -> Add .NET Aspire orchestrator support with 9.0.
  2. F5/Ctrl+F5 the project.
  3. Click on the "Start" button under "Actions" for consoleapp2 on the Dashboard. Image
  4. Once the "Start" button switches back to "Stop" button -> Repeat Step 3. Check whether the "Stop" button switches to "Start".

Expect: The "Stop" button switches to "Start" successfully. Image

Actual: The "Stop" button doesn't switch to "Start" with 'consoleapp2 "Stop" succeeded' message pops up. Image

More Info:

  1. The probability of this problem occurring: More than 80%.
  2. This issue also reproduces for Console App (.NET Framework) and Console App VB projects.
  3. This issue doesn't reproduce for ASP .NET Core Empty project.
joperezr commented 1 week ago

[Triage] - Hey @amnabatr1sha thanks for logging the issue. Can you please try this again using a newer version of Aspire from our main branch (it would be one with version 9.0.0-preview5.) Looks like the version you are using is a bit old and we want to understand if this still repros. THanks!

amnabatr1sha commented 1 week ago

Verified on Aspire 9.0.0-preview.5.24515.5, this issue still reproduces but it is unstable with the probability of 80% of it occurring.

dbreshears commented 1 week ago

I have been unable to reproduce this on 9.0.0-preview.5.24515.5. @amnabatr1sha, can you set the environment variable below, do the minimal repro and send over email. Log files should be in %temp%\dcp\logs

DCP_DIAGNOSTICS_LOG_LEVEL=DEBUG

v-mengwe commented 1 week ago

Hi @dbreshears , verified on the Aspire 9.0.0-rc.2.24516.6, this issue still reproduces and sent the log over the email. And this issue only reproduces when the state of Console C# App project shows/changes "Running" not "Finished" in the dashboard.

dbreshears commented 1 week ago

When this reproduces (which I have only been able to do on the repro machine), we don't seem to be getting an IDE run session terminated, so looks like a timing issue maybe on slower machines. @vijayrkn, @tlmii

mitchdenny commented 4 days ago

I'm trying this out and cannot reproduce either (I'm using the WaitFor playground that has a console app).

v-mengwe commented 1 day ago

This issue doesn't reproduce after putting a loop code for the Console C# project.