← All recipes
Moderne licensed

Find catch (OutOfMemoryException) that may need ExternalException

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

In .NET 10, System.Drawing GDI+ errors now throw ExternalException instead of OutOfMemoryException. This recipe finds catch blocks that catch OutOfMemoryException which may need to also catch ExternalException.

Single recipenet10searchdotnetwinformsProprietary

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

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

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