DEV Community

Rename a C# Project

Mattias Cibien on January 20, 2020

One of the problems beginners face when using Visual Studio happens when they try to rename a project since there will be a lot of leftovers in the...
Collapse
 
modernronin profile image
ModernRonin

Actually, you can just use a little utility I wrote that also deals with git (so the history doesn't get lost), paket (if you use it), moving projects to other directories etc.

Install via dotnet tool install -g ModernRonin.ProjectRenamer, see github.com/ModernRonin/ProjectRenamer for documentation.

Cheers,
MR

Collapse
 
dougedmunds profile image
dougedmunds

There are many files with the old namespace in the directories 'bin' and 'obj'. Is it safe to delete the bin and obj directories and let the system recreate them?

Collapse
 
mattiascibien profile image
Mattias Cibien

Bin and obj are temporary folders generated by the C# compiler. They can be safely deleted and should never be committed in Version Control. If you need something to quickly cleanup those I suggest the shell scripts that you can find on stackoverflow.com/questions/755382...