如何将项目移动到Visual Studio中的不同文件夹?在我的项目中,我习惯了这种结构。
-- app
---- Project.Something
---- Project.SomethingElse
我想将整个命名空间SomethingElse重命名为SomethingNew,最好的方法是什么(无需手动进入.sln文件)?
如何将项目移动到Visual Studio中的不同文件夹?在我的项目中,我习惯了这种结构。
-- app
---- Project.Something
---- Project.SomethingElse
我想将整个命名空间SomethingElse重命名为SomethingNew,最好的方法是什么(无需手动进入.sln文件)?
当前回答
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.
其他回答
在visual studio community 2019中,我做了Victor David Francisco Enrique说的,但只需要删除.vs invisible文件夹
使用解决方案文件夹将相关项目分组在一起
见http://msdn.microsoft.com/en-us/library/vstudio/c6c756s6 (v = vs.100) . aspx
在VS 2015
在解决方案资源管理器中卸载项目 创建一个新的解决方案 将项目复制到新解决方案的文件夹中 右键单击解决方案,添加现有项目。 如果使用MVC等框架,则可能需要在引用管理器中添加引用。
通过在“解决方案资源管理器”窗口中右键单击项目并选择“删除”,可以从解决方案中删除项目。移动整个项目文件夹,包括您想要移动的子目录。将项目添加回解决方案。
命名空间名称则完全不同,只需编辑源代码即可。
我也有同样的问题。我解决了移动参考,在不到15分钟,没有改变参考。
对我来说,解决办法很简单:
Move your files where you need. Delete the folder with name .vs. Must be as not visible folder. Open the solution file (.sln) using a simple editor like note or notepad++. Change the reference where your file is, using the following structure: if you put your project in the same folder remove the previous folder or the reference "..\"; if you put in a above folder add the reference "..\" or the name of the folder. Save the file with the changes. Open the project file (.csproj) and do the same, remove or add the reference. Save the changes. Open the solution file.
例子:
在解决方案文件(.sln)中
Original: Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PATH1.UI", "ScannerPDF\PATH1.UI\PATH1.UI.csproj", "{A26438AD-E428-4AE4-8AB8-A5D6933E2D7B}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PATH1.DataService", "ScannerPDF\PATH1.DataService\PATH1.DataService.csproj", "{ED5A561B-3674-4613-ADE5-B13661146E2E}" New: Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PATH1.MX.UI", "PATH1.MX.UI\PATH1.UI.csproj", "{A26438AD-E428-4AE4-8AB8-A5D6933E2D7B}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PATH1.DataService", "PATH1.DataService\PATH1.DataService.csproj", "{ED5A561B-3674-4613-ADE5-B13661146E2E}"
在项目文件中:
原: 新: 原始参考: …\ lib \ RCWF \ 2018.1.220.40 \ TelerikCommon.dll 新的参考: . . \ lib \ RCWF \ 2018.1.220.40 \ TelerikCommon.dll