← All recipes
Moderne licensed

Remove MSBuild property

Recipe IDOpenRewrite.CSharp.Recipes.RemoveMSBuildPropertyArtifactOpenRewrite.Recipes.CSharp.Core

Removes an MSBuild property element (e.g. <RuntimeFrameworkVersion>) from <PropertyGroup> in .csproj files.

Single recipeProprietary

Usage

You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe OpenRewrite.CSharp.Recipes.RemoveMSBuildProperty --recipe-option "PropertyName=RuntimeFrameworkVersion"

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

mod config recipes nuget install OpenRewrite.Recipes.CSharp.Core

Options

NameTypeDescription
PropertyNamerequiredStringThe MSBuild property element name to remove (case-sensitive).
e.g. RuntimeFrameworkVersion
RegenerateMarkerBooleanWhether to re-run dotnet restore after the edit to refresh the project's MSBuildProject marker. Defaults to true. Composite recipes that chain multiple csproj-mutating steps may set this to false on intermediate steps and finalize once with EnsureCsprojAttestation.