lr.Dotnet.RenameReplaceTool.any 2026.3.24.1737

dotnet add package lr.Dotnet.RenameReplaceTool.any --version 2026.3.24.1737
                    
NuGet\Install-Package lr.Dotnet.RenameReplaceTool.any -Version 2026.3.24.1737
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="lr.Dotnet.RenameReplaceTool.any" Version="2026.3.24.1737" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="lr.Dotnet.RenameReplaceTool.any" Version="2026.3.24.1737" />
                    
Directory.Packages.props
<PackageReference Include="lr.Dotnet.RenameReplaceTool.any" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add lr.Dotnet.RenameReplaceTool.any --version 2026.3.24.1737
                    
#r "nuget: lr.Dotnet.RenameReplaceTool.any, 2026.3.24.1737"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package lr.Dotnet.RenameReplaceTool.any@2026.3.24.1737
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=lr.Dotnet.RenameReplaceTool.any&version=2026.3.24.1737
                    
Install as a Cake Addin
#tool nuget:?package=lr.Dotnet.RenameReplaceTool.any&version=2026.3.24.1737
                    
Install as a Cake Tool

lr-rename-replace

NuGet

A command-line tool for bulk-renaming projects. It renames folders, files, and text content in one go. Unlike simple search-and-replace scripts, it processes directories from the inside out, ensuring that deep project hierarchies are renamed safely without breaking any paths.

Usage

Run it directly with dnx:

dnx -y lr.Dotnet.RenameReplaceTool <directory> <old@new> [another-old@another-new]

Examples

Rename a project and its namespace:

dnx -y lr.Dotnet.RenameReplaceTool . MyProject@OurProject

Rename multiple things at once:

dnx -y lr.Dotnet.RenameReplaceTool ./src "OldApp@NewApp" "v1@v2" "internal@public"

How it works

The tool goes through three steps to make sure nothing gets lost or broken:

  1. Directories first (Inside-Out) It renames folders starting from the deepest ones. This is important because if you rename a parent folder first, the paths to all its sub-folders would change, and the tool wouldn't be able to find them anymore. When a folder is renamed, all its contents are moved to the new location automatically.

  2. File names After folders are handled, it goes through every file and renames it if the filename matches any of your search terms.

  3. Text content Finally, it reads the content of every file and performs the replacements.

    • Binary safety: It checks for null bytes. If it finds 3 or more, it assumes the file is binary (like an image or executable) and leaves it alone.
    • BOM Preservation: If your text files use a UTF-8 BOM (Byte Order Mark), the tool detects it and makes sure it's kept when the file is saved.

Good to know

  • Case Sensitivity: Replacements are case-sensitive. If you need to rename both MyProject and myproject, provide both pairs: MyProject@OurProject myproject@ourproject.
  • Spaces: If your search or replacement strings have spaces, wrap the whole pair in quotes: "Old Name@New Name".
  • Safety: It's always best to run this on a clean git state so you can easily undo the changes if needed.

Installation

If you prefer to have it installed globally on your machine:

dotnet tool install -g lr.Dotnet.RenameReplaceTool

Usage after installation:

lr-rename-replace . Old@New
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.3.24.1737 174 3/24/2026
2026.3.24.1722 111 3/24/2026