← All recipes
Moderne licensed

Remove DotNetCliToolReference

Recipe IDOpenRewrite.CSharp.Recipes.RemoveDotNetCliToolReferenceArtifactOpenRewrite.Recipes.CSharp.Core

Removes a <DotNetCliToolReference> element from .csproj files. Use * to remove every CLI tool reference.

Single recipeProprietary

Usage

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

mod run . --recipe OpenRewrite.CSharp.Recipes.RemoveDotNetCliToolReference --recipe-option "ToolName=Microsoft.DotNet.Watcher.Tools"

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

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

Options

NameTypeDescription
ToolNamerequiredStringThe CLI tool package name to remove. Supports glob patterns. Use * to remove all CLI tool references.
e.g. Microsoft.DotNet.Watcher.Tools
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.