How to duplicate a Visual Studio Project on macOS
Tweet
1) Duplicate project
Click on the project folder and press CMD-D on the keyboard.
2) Rename folder
Rename the [VS Project Name] copy to your [New VS Project Name]
3) Rename files and folders inside the project
Open Terminal and type the following commands:
$ cd [your projects folder]/[New VS Project Name]
$ for file in $(find . -name '*[VS Project Name]*'); do mv "$file" "${file/[VS Project Name]/[New VS Project Name]}"; done
4) Rename '[VS Project Name]' inside the project files
4.a
- Open the application 'VS Code' (download here )
- Add the Visual Studio project folder into a VS Code project, if it is not already.
- Open Search + Replace
- Set 'Case sensitive' to 'On'
4.b
- Search for [VS Project Name]. A maximum of 20000 results are listed.
- Replace all with [New VS Project Name]
- Search again
- Repeat until no more occurrences are found.
4.c
- Search for [vs project name] (all lowercase). Max results are again just 20000.
- Replace all with [new vs project name] (also all lowercase)
- Search again
- Repeat until no more occurrences are found.
4.d
In 4.b and/or 4.c you will have seen literal path names to project files.
Use Find & Replace to change those paths into the new paths.
5. New icons
Don't forget to create new icons for the new app.
6. Clean
Open the new project in Visual Studio, and choose 'Clean all' under the 'Build' menu.
That's it!