如何将项目移动到Visual Studio中的不同文件夹?在我的项目中,我习惯了这种结构。
-- app
---- Project.Something
---- Project.SomethingElse
我想将整个命名空间SomethingElse重命名为SomethingNew,最好的方法是什么(无需手动进入.sln文件)?
如何将项目移动到Visual Studio中的不同文件夹?在我的项目中,我习惯了这种结构。
-- app
---- Project.Something
---- Project.SomethingElse
我想将整个命名空间SomethingElse重命名为SomethingNew,最好的方法是什么(无需手动进入.sln文件)?
当前回答
这在VS2012中很简单;只需使用变更映射特性:
创建要将解决方案移动到的文件夹。 签入所有项目文件(如果您想保留更改),或回滚任何签出的文件。 关闭解决方案。 打开源代码控制资源管理器。 右键单击解决方案,并选择“高级-> Remove Mapping…” 将“Local Folder”的值更改为步骤#1中创建的值。 选择“改变”。 通过在源代码控制资源管理器中双击解决方案来打开解决方案。
其他回答
使用解决方案文件夹将相关项目分组在一起
见http://msdn.microsoft.com/en-us/library/vstudio/c6c756s6 (v = vs.100) . aspx
通过在“解决方案资源管理器”窗口中右键单击项目并选择“删除”,可以从解决方案中删除项目。移动整个项目文件夹,包括您想要移动的子目录。将项目添加回解决方案。
命名空间名称则完全不同,只需编辑源代码即可。
我发现这个方法,这个方法对我有用。
在visual studio 2017社区版中,它在此路径创建一个项目 ”马克C: \用户\ \ \回购\产生来源\产生” 这将产生一个文件访问被拒绝的问题
现在,你可以用这种方法解决这个问题。
close your visual studio process. Then, find your project and copy the project folder But, first make a Sub-folder Named Projects inside of your visual studio 2017 folder in documents. Next, paste the project folder inside of your visual studio 2017 Project folder not the main visual studio 2017 folder it should go into the Sub-folder called Projects. Next, restart Visual studio 2017 Then, choose Open project Solution Then, find your project you pasted in your visual studio 2017 Projects folder Then clean the Project and rebuild it , It, should build and compile just fine. Hope, this Helped out anybody else. Not to sure why Microsoft thought building your projects in a path where it needs write permissions is beyond me.
我也有同样的问题。我解决了移动参考,在不到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
我尝试了删除和重新添加项目的建议,但修复依赖关系可能会很痛苦。
我使用这种方法:
移动项目文件夹。 如果项目在源代码控制中,则使用源代码控制命令执行移动。 在文本编辑器中编辑解决方案文件。你应该只需要改变一条路径。