← All recipes
Moderne licensed

Find BackgroundService.ExecuteAsync behavior change

Recipe IDOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindBackgroundServiceExecuteAsyncArtifactOpenRewrite.Recipes.CSharp.Migration.Dotnet

Finds methods that override ExecuteAsync from BackgroundService. In .NET 10, the entire method runs on a background thread; synchronous code before the first await no longer blocks host startup.

Single recipenet10searchdotnethostingProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net10.FindBackgroundServiceExecuteAsync

If the recipe isn’t available locally, install it with:

mod config recipes nuget install OpenRewrite.Recipes.CSharp.Migration.Dotnet