← All recipes
Moderne licensed

Find NuGet package reference

Recipe IDOpenRewrite.CSharp.Recipes.FindNuGetPackageReferenceArtifactOpenRewrite.Recipes.CSharp.Core

Searches for .csproj files that reference a specific NuGet package. Intended for use as a precondition to scope other recipes.

Single recipeProprietary

Usage

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

mod run . --recipe OpenRewrite.CSharp.Recipes.FindNuGetPackageReference --recipe-option "PackageName=Swashbuckle.AspNetCore"

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

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

Options

NameTypeDescription
PackageNamerequiredStringThe NuGet package name to search for. Supports glob patterns.
e.g. Swashbuckle.AspNetCore