← All recipes
Moderne licensed

Find KeyedService.AnyKey behavior change

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

Finds usages of KeyedService.AnyKey which has changed behavior in .NET 10. GetKeyedService(AnyKey) now throws InvalidOperationException and GetKeyedServices(AnyKey) no longer returns AnyKey registrations.

Single recipenet10searchdotnetdiProprietary

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.FindKeyedServiceAnyKey

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

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