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

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

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


当前回答

在VS 2015

在解决方案资源管理器中卸载项目 创建一个新的解决方案 将项目复制到新解决方案的文件夹中 右键单击解决方案,添加现有项目。 如果使用MVC等框架,则可能需要在引用管理器中添加引用。

其他回答

对我有效的方法是:

从解决方案中删除项目。 使用文本编辑器编辑项目文件。 更新“包”的所有相对路径。就我而言,我不得不改变。\包裹到..\..\包,因为我把项目移动到一个更深的文件夹。 将项目加载回解决方案中。

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.

在VS2012中关闭解决方案 将项目移动到新位置 打开你的溶液 选择加载失败的项目 在属性工具窗口中,有一个可编辑的“文件路径”条目,允许您选择新的项目位置 设置新路径 右键单击项目并单击重新加载

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

这在VS2012中很简单;只需使用变更映射特性:

创建要将解决方案移动到的文件夹。 签入所有项目文件(如果您想保留更改),或回滚任何签出的文件。 关闭解决方案。 打开源代码控制资源管理器。 右键单击解决方案,并选择“高级-> Remove Mapping…” 将“Local Folder”的值更改为步骤#1中创建的值。 选择“改变”。 通过在源代码控制资源管理器中双击解决方案来打开解决方案。