Skip to content

Add warning that VS and Docker don't hit Stop events #34407

@JohnGoldsmith

Description

@JohnGoldsmith

Description

Hi, I don't think I've missed it in this article, but I've found that when trying to debug BackgroundService stop events in Visual Studio and Docker Desktop, the process is terminated and code in these events is never hit.

It would be helpful to highlight this somewhere in the article, unless you feel that it's too specific to a particular IDE / Setup?

You can see an issue that I raised about this in the DockerTools issues repo here:

microsoft/DockerTools#451

I don't think it's necessary to add the workaround, but just highlighting the behaviour would save people a lot of time. Or at least me anyway :)

Best regards, John

Page URL

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-9.0&tabs=visual-studio

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/host/hosted-services.md

Document ID

b2dece1f-15b8-03af-6d52-7cc070432b4b

Article author

@tdykstra

Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions