Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BackgroundService StopAsync never called #319

Open
krisnashaypp opened this issue Dec 9, 2024 · 0 comments
Open

BackgroundService StopAsync never called #319

krisnashaypp opened this issue Dec 9, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@krisnashaypp
Copy link

Hi, thanks for a great plugin!

Describe the bug
On Aspire 9 I have a problem that when I stop aspire, or stop my worker service in particular, the BackgroundService method StopAsync is never called. When I run my worker service directly and I hit stop I can see the log that StopAsync is called as expected.

I even tried writing a file to disk in StopAsync just to make sure I wasn't just missing the logs somehow, and it doesn't get written when stopping Aspire.

I first reported this on Aspires issues but was told this should be reported as an IDE bug since the IDE is responsible for this process. Issue

To Reproduce
Steps to reproduce the behavior:

  1. Create worker project in Aspire solution
  2. Create background service that overrides StopAsync
  3. When stopping AppHost, StopAsync is never called for worker project

Expected behavior
Same behaviour as when worker project is run directly and is stopped by Rider

Additional context
Dotnet 9 and Aspire 9.

@krisnashaypp krisnashaypp added the bug Something isn't working label Dec 9, 2024
@rafaelldi rafaelldi self-assigned this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants