VisualStudio-如何在不中断解决方案的情况下更改项目的文件夹名称和解决方案名称

我正在创建一个基于旧项目的项目,因为它有很多我需要使用的功能。

我想重命名所有目录和解决方案的名称,使其具有新项目的名称。在“文档 VisualStudio2008项目”下,我能够更改初始目录和解决方案文件名,但不能更改存放 binobj和属性文件夹的子目录的名称。当我更改该子目录的名称时,打开解决方案时将不会打开任何文件。

如何在 VisualStudio2008中更改项目的文件夹名称,以便它将所有文件作为解决方案的一部分加载并仍然可以工作?

120045 次浏览

You could open the SLN file in any text editor (Notepad, etc.) and simply change the project path there.

This is what I did:

  1. Change project and solution name in Visual Studio
  2. Close the project and open the folder containing the project (The Visual studio solution name is already changed).
  3. Change the old project folder names to the new project name
  4. Open the .sln file and the change the project folder names manually from old to new folder names.
  5. Save the .sln file in the text editor
  6. Open the project again with Visual Studio and the solution is ready to modify

I found that these instructions were not enough. I also had to search through the code files for models, controllers, and views as well as the AppStart files to change the namespace.

Since I was copying my project not just renaming it, I also had to go into the applicationhost.config for IIS express and recreate the bindings using different port numbers and change the physical directory as well.

go to my start-documents-iisExpress-config and then right click on applicationhost and select open with visual studio 2013 for web you will get into applicationhost.config window in the visual studio and now in the region chsnge the physical path to the path where your project is placed