← All recipes
Moderne licensed

Find BinaryFormatter usage (removed in .NET 9)

Recipe IDOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net9.FindBinaryFormatterArtifactOpenRewrite.Recipes.CSharp.Migration.Dotnet

Finds usages of BinaryFormatter which always throws NotSupportedException in .NET 9. Migrate to a different serializer such as System.Text.Json, XmlSerializer, or DataContractSerializer.

Single recipeserializationsearchdotnetnet9Proprietary

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.Net9.FindBinaryFormatter

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

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