Skip to content

Update hosted-services.md to reflect BackgroundService.StartAsync breaking change#37054

Merged
tdykstra merged 2 commits intodotnet:mainfrom
dionrhys:patch-1
May 5, 2026
Merged

Update hosted-services.md to reflect BackgroundService.StartAsync breaking change#37054
tdykstra merged 2 commits intodotnet:mainfrom
dionrhys:patch-1

Conversation

@dionrhys
Copy link
Copy Markdown
Contributor

@dionrhys dionrhys commented Apr 26, 2026

As of dotnet/runtime#116283 (issue: dotnet/runtime#36063) landing in .NET 10, BackgroundService.StartAsync no longer blocks until the BackgroundService.ExecuteAsync implementation reaches an await point; StartAsync now always runs ExecuteAsync on the thread pool using Task.Run.

This PR updates the wording for .NET 10+ versions to reflect the new behaviour. Previous versions of the page (.NET 8 and 9) retain the existing wording.

If it's desirable, I could also provide a warning of the breaking change on the .NET 10+ versions of the page in case someone's landed on latest docs but are actually working on .NET 8 or 9, so they don't get a surprise hang during app startup.

Let me know if you'd like any changes. ✌


Internal previews

📄 File 🔗 Preview link
aspnetcore/fundamentals/host/hosted-services.md Background tasks with hosted services in ASP.NET Core

…aking change

As of dotnet/runtime#116283 (in .NET 10), `BackgroundService.StartAsync` no longer blocks until the `BackgroundService.ExecuteAsync` implementation reaches an `await` point; `StartAsync` now always runs `ExecuteAsync` on the thread pool using `Task.Run`.
Comment thread aspnetcore/fundamentals/host/hosted-services.md
@tdykstra tdykstra merged commit a28c16f into dotnet:main May 5, 2026
4 checks passed
@tdykstra
Copy link
Copy Markdown
Contributor

tdykstra commented May 5, 2026

Thanks, @dionrhys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants