← All recipes
Moderne licensed

Find BinaryReader.ReadString behavior change

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

Finds calls to BinaryReader.ReadString() which now returns the Unicode replacement character (\uFFFD) for malformed UTF-8 byte sequences in .NET 9, instead of the previous behavior. Verify your code handles the replacement character correctly.

Single recipesearchdotnetnet9Proprietary

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

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

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