Find List<T>.ForEach modification-during-enumeration change
Recipe ID
OpenRewrite.Recipes.CSharp.Migration.Dotnet.NetFramework.FindListForEachDuringMutationArtifactOpenRewrite.Recipes.CSharp.Migration.DotnetFinds calls to List<T>.ForEach, which throws InvalidOperationException if the collection is modified during enumeration when retargeting to .NET Framework 4.5 (previously the modification was silently ignored).
Single recipesearchdotnetnet-frameworkcollectionsProprietary
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.NetFramework.FindListForEachDuringMutationIf the recipe isn’t available locally, install it with:
mod config recipes nuget install OpenRewrite.Recipes.CSharp.Migration.Dotnet