是否可以在Visual Studio中重命名项目,使其文件夹名也重命名? [英] Is it possible to rename a project in Visual Studio such that its folder name is also renamed?

查看:136
本文介绍了是否可以在Visual Studio中重命名项目,使其文件夹名也重命名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我们正在开发一个名为MyProject的项目. 我希望能够将其名称更改为MyProject2,并将其文件夹名称也重命名为MyProject2.

Let's assume we're working on a project called MyProject. I'd like to be able to change its name to MyProject2 AND have its folder name also renamed to MyProject2.

这可以从Visual Studio中进行吗?如果没有,如何使它发生在外部"呢?

Is this possible from Visual Studio? If not, how to make this happen "outside" it?

推荐答案

将项目重命名为新名称.它将自动更改.csproj文件,该文件在2010年为项目名称.关闭Visual Studio.重命名目录.

Rename your project to your new name. It will change the .csproj file automatically which in 2010 is the name of the project. Close Visual Studio. Rename the directory.

现在打开您的解决方案文件以更改目录.您的解决方案文件将指向新项目,但将引用错误的目录.

Open your solution file to change directory now. Your solution file will point to the new project but will reference the wrong directory.

之前:

 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stackoverflow_4560662_Rename",    "Stackoverflow_4560662\Stackoverflow_4560662_Rename.csproj", "{7CCD10BF-48BA-44E2-B071-D4ED8067ACA1}"

之后

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stackoverflow_4560662_Rename", "Stackoverflow_4560662_Rename\Stackoverflow_4560662_Rename.csproj", "{7CCD10BF-48BA-44E2-B071-D4ED8067ACA1}"

注意这两个部分 "Stackoverflow_4560662 \ Stackoverflow_4560662_Rename.csproj"变为 "Stackoverflow_4560662_Rename \ Stackoverflow_4560662_Rename.csproj"

Notice the two parts "Stackoverflow_4560662\Stackoverflow_4560662_Rename.csproj" becomes "Stackoverflow_4560662_Rename\Stackoverflow_4560662_Rename.csproj"

这是我能够重命名项目目录的唯一方法.我希望有人能找到更好的答案.

This is the only way I've been able to rename a directory for a project. I hope someone finds a better answer.

这篇关于是否可以在Visual Studio中重命名项目,使其文件夹名也重命名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆