Preserve reviewed Core compiler defines for selected modern targets

Proprietary

Broadens a bare positive netcoreapp PropertyGroup condition containing only literal DefineConstants appends in one exact SDK project. Retains the original predicate and appends finite equality checks for explicitly reviewed, already declared net8.0/net9.0/net10.0 targets. Standalone opt-in; does not infer compiler-symbol portability.

OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net8.PreserveReviewedCoreDefineConditions

Required

Exact relative captured .csproj path, without globs or parent segments.

Semicolon-separated literal net8.0, net9.0 or net10.0 targets already declared unconditionally by this project.

Default false. Owner accepts the original Core compiler define payload at its original evaluation position for each selected modern target. Review ancestor, imported/package, environment and CI policy, global TargetFramework overrides and all compiler-symbol consumers, including policy absent from the captured model. Confirm these symbols have no consumers that change restore dependencies, project references or target metadata. This is manual policy acceptance, not graph or build attestation.

mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net8.PreserveReviewedCoreDefineConditions \ -P ExactProjectPath='<ExactProjectPath>' \ -P SelectedModernTargets='<SelectedModernTargets>' \ -P CoreDefinePolicyReviewed=false

Required options ExactProjectPath, SelectedModernTargets have no example to run with. Fill them in above.

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.