如何从 Visual Studio 中重命名项目文件夹? [英] How can I rename a project folder from within Visual Studio?

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

问题描述

我目前重命名项目文件夹的解决方案是:

My current solution for renaming the project folder is:

  • 从解决方案中删除项目.
  • 在 Visual Studio 外重命名文件夹.
  • 将项目重新添加到解决方案中.

有更好的方法吗?

推荐答案

这在 Visual Studio 2015 中很简单(可能适用于旧版本)

  1. 在解决方案资源管理器中,右键单击主要解决方案重命名
  2. 在解决方案资源管理器中,右键单击项目(在解决方案下)→重命名
  3. 在解决方案资源管理器中,双击或右键单击属性 →转到 Application Tab,重命名 Assembly nameDefault namespace 以匹配.
  4. 如果您还想重命名命名空间,请打开您的类文件之一.右键单击命名空间 →重命名....这应该搜索并替换整个项目中对您的命名空间的所有引用.
  5. 关闭项目 →重命名项目文件夹.
  6. 记事本中编辑.sln文件, 并更改 csproj 的路径,即 fuar.csprojbarar.csproj.
  1. In Solution Explorer, right click on Main solutionRename
  2. In Solution Explorer, right click on project (under solution) → Rename
  3. In Solution Explorer, double click, or right click on Properties → goto Application Tab, rename Assembly name and Default namespace to match.
  4. If you wish to also rename the namespace, open one of your class files. Right click the namespace → Rename.... This should search and replace all references to your namespace throughout the project.
  5. Close the project → rename the project folder.
  6. Edit the .sln file in Notepad, and change the path to the csproj, i.e., fuar.csprojbarar.csproj.

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

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