简体   繁体   English

如何在 Visual Studio 2017 中克隆和重命名项目?

[英]How to clone and rename a project in Visual Studio 2017?

I have a Project & Solution .sln in Visual Studio 2017. How to rename it in Visual Studio 2017 ?我在 Visual Studio 2017 中有一个项目和解决方案.sln 。如何在Visual Studio 2017 中重命名它?

It is written in C#.它是用 C# 编写的。

Finally managed to figured it out as below;最后设法弄清楚如下;

  1. Rename the project: WindowsFormsApplication2 to NewName将项目重命名: WindowsFormsApplication2NewName
  2. Rename the output folder to NewName: WindowsFormsApplication2 to NewName将 output 文件夹重命名为 NewName: WindowsFormsApplication2NewName
  3. Open the Solution (WindowsFormsApplication2.sln) with VisualStudio 2017 and Right click to rename WindowsFormsApplication2 to NewName Make sure to rename both Project name and Solution name使用 VisualStudio 2017 打开解决方案 (WindowsFormsApplication2.sln) 并右键单击以将 WindowsFormsApplication2 重命名为 NewName确保重命名项目名称和解决方案名称
  4. Open Solution's properties from Project-> NewName properties Tool Menu and Rename Assembly Name , ** Default Namespace** also Assembly info with NewName从 Project-> NewName properties Tool Menu 和Rename Assembly Name打开解决方案的属性,** Default Namespace** 以及带有NewNameAssembly info
  5. Open one of the *.cs file and rename the namespace from: namespace WindowsFormsApplication2 to namespace NewName using right click on WindowsFormsApplication2打开*.cs文件之一并将命名空间从:命名空间 WindowsFormsApplication2重命名为命名空间 NewName ,使用右键单击WindowsFormsApplication2

Now both the Project and Solution should be fully renamed and able to build/rebuild.现在项目和解决方案都应该完全重命名并且能够构建/重建。

I do not have any answer to this.我对此没有任何答案。 Because I did not understand your question itself.因为我不明白你的问题本身。 Will you be more specific with your question.你的问题会更具体吗? Just reframe the question once again.再次重新构建问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM