Any ideas on how to move (and rename) a Visual Studio project item? I want to move (and rename) an item from one location in the hierarchy to another location in the hierarchy. I want this through automation on the Visual Studio object model, so I will not get int开发者_StackOverflowo trouble with source control (having to checkout and checkin files).
You need to do it in four steps (no other easy way):
- From visual studio rename the project (this renames the .VCproj file) (You can do this after step 2 if you want to track vcproj changes in source control).
- Remove the project from the solution (without deleting the files).
- Using File Explorer change the project directory name, and move it to where you want it (physically). - you can use SVN rename for this step.
- From visual studio add an existing project.
精彩评论