Skip to content

Visual Studio project renaming (renames within files, file names and directory names)

License

Notifications You must be signed in to change notification settings

appsoftwareltd/dotnet-project-rename

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

.NET Project Rename

.NET project renaming (within files, file names and directory names)

This console application is designed for finding and replacing text throughout .NET / Visual Studio projects, including inside project and data files, along with file and folder names, including solution files. By recursively renaming at the root of the project, you can avoid breaking links to project files and references to other projects in the solution.

You may want to do this if you are reusing an existing project as a base for a new project, but need to replace old names.

If you have a project with the name Foo.Bar, which is used in namespaces, project names and file and folder names, and you want to change it to My.New.Project, then run the program and enter the path, the find text (Foo.Bar) and the replace text (My.New.Project) when prompted.

Example

You can also run from the command line by passing arguments instead:

  • -p : Directory path
  • -f : Find text
  • -r : Replace text

Run with --help for help text.

All instances of the find text will be replaced, giving you a completely renamed project throught the file structure.

An attempt is made to avoid corrupting files managed by version control and visual studio (so .git, .svn and .vs directories are ignored). This list is not exhaustive though so ideally you will have the solution code in a directory other than where these files sit.

Running dotnet-script version

A version of this tool for running with dotnet-script is included in this repository at src/dotnet-script/app.csx.

Full documentation for dotnet-script is here: https://github.com/filipw/dotnet-script

To run using dotnet-script, you need to have the .NET Core 2.2 runtime installed.

If you do not have dotnet-script installed you can then install the tool using:

dotnet tool install -g dotnet-script

Navigate your terminal to the directory in this repository src/dotnet-script.

Run > dotnet script app.csx

Running remotely

Since dotnet-script allows for running of scripts from remote locations, you can run the .csx script file without downloading this repository:

> dotnet script https://raw.githubusercontent.com/appsoftwareltd/dotnet-project-rename/master/src/dotnet-script/app.csx

About

Visual Studio project renaming (renames within files, file names and directory names)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published