如何将项目移动到Visual Studio中的不同文件夹?在我的项目中,我习惯了这种结构。

-- app
---- Project.Something
---- Project.SomethingElse

我想将整个命名空间SomethingElse重命名为SomethingNew,最好的方法是什么(无需手动进入.sln文件)?


当前回答

This worked for me vb2019. I copied my source project folder. I then pasted the project, and renamed the the folder to whatever. In order to break the ties back to the source project folder, I temporarily renamed the source folder. I opened my destination project. The paths to the forms and modules were re-discovered in the local folder. I went through all my forms and modules to make sure they were working. I ran the project. I closed the project. I renamed the source project folder back to is't original name. I can open both projects at the same time without errors.

其他回答

我尝试了删除和重新添加项目的建议,但修复依赖关系可能会很痛苦。

我使用这种方法:

移动项目文件夹。 如果项目在源代码控制中,则使用源代码控制命令执行移动。 在文本编辑器中编辑解决方案文件。你应该只需要改变一条路径。

复制项目文件夹到新目标 从解决方案中删除项目(在“解决方案资源管理器”中右键单击项目并选择“删除”) 然后将现有项目添加到解决方案中(在“解决方案资源管理器”中右键单击项目,选择“添加”,然后选择“现有项目”) 将路径更改为“YourProjectName”中的“packages”文件夹。csproj"文件(在记事本中打开并更改链接包的路径)

关闭解决方案并将项目移动到新的文件夹/位置 重新打开溶液 项目应该加载的'+'叹息指的是未检查的部分。所有的文件 将显示为“重命名”。 如果重新打开后不工作,右键单击项目,然后单击卸载 重新加载。 它在VS2019中有效

通过在“解决方案资源管理器”窗口中右键单击项目并选择“删除”,可以从解决方案中删除项目。移动整个项目文件夹,包括您想要移动的子目录。将项目添加回解决方案。

命名空间名称则完全不同,只需编辑源代码即可。

使用解决方案文件夹将相关项目分组在一起

见http://msdn.microsoft.com/en-us/library/vstudio/c6c756s6 (v = vs.100) . aspx