Skip to main content
Moderne OnlyThis recipe is proprietary to Moderne and runs on the Moderne platform or CLI — it isn’t part of the open-source catalog. Available with a Moderne subscription.Contact Sales

Remove MSBuild property

Recipe IDOpenRewrite.CSharp.Recipes.RemoveMSBuildProperty
ArtifactOpenRewrite.Recipes.CSharp.Core

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

Single recipeOpenRewriteModerne Proprietary License
Try in PlatformTry this recipe in the Moderne platform. Not a user yet? You’ll get a no-setup demo environment, with nothing to install or configure.

Options

2 parameters
1 required1 optional
ParameterExampleTypeRequired
PropertyNameRuntimeFrameworkVersionStringRequired
The MSBuild property element name to remove (case-sensitive).
RegenerateMarkerBooleanOptional
Whether 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.

Usage

Run this recipe

In order to run C# recipes, you will need to use the Moderne CLI.

Once the CLI is installed, you can install this C# recipe package by running the following command:

Install the recipe package
mod config recipes nuget install OpenRewrite.Recipes.CSharp.Core

Then, you can run the recipe via:

Run the recipe
mod run . --recipe OpenRewrite.CSharp.Recipes.RemoveMSBuildProperty