Use X509CertificateLoader (SYSLIB0057)
Recipe ID
OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net9.UseX509CertificateLoaderArtifactOpenRewrite.Recipes.CSharp.Migration.DotnetReplace new X509Certificate2(path, password) with X509CertificateLoader.LoadPkcs12FromFile(path, password). The two-argument X509Certificate2 constructor is obsolete in .NET 9 (SYSLIB0057).
Single recipecsharpdotnetcryptographyProprietary
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.UseX509CertificateLoaderIf the recipe isn’t available locally, install it with:
mod config recipes nuget install OpenRewrite.Recipes.CSharp.Migration.Dotnet