change solution file to a different folder

后端 未结 9 1053
遥遥无期
遥遥无期 2021-02-03 18:03

How do I change the folder of my existing solution file (sln)?

It\'s right now inside one of my project\'s folder; if I cut the solution file and paste it in the root fo

相关标签:
9条回答
  • 2021-02-03 18:29

    The solution file is just a text file. You should be able to move it and then edit it to make sure that any relative paths referenced in the file are correct.

    I've also been able to right-click on the solution file in the solution explorer and then use save-as to save it in a different location. That doesn't seem to work everytime for me though.

    0 讨论(0)
  • 2021-02-03 18:37

    I just had to do this with some legacy projects I inherited so thought it might be worth documenting...

    After upgrading from VS 2005 solution, I noticed that the solution file was at the same level as the project files. Our standard is to have the solution file one level above.

    Undesired location of solution file.

    Opening the solution file in 'Notepad' I see the following:

    Unchanged Solution file opened in notpad.

    Add required relative path to each of the project path and save in correct location:

    In my case to bring up one level 'BloombergPriceRequestService\'

    SO project line(s) will look like this:

    Microsoft Visual Studio Solution File, Format Version 11.00
    # Visual Studio 2010
    Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BloombergPaydownService", "BloombergPaydownService\BloombergPaydownService.csproj", "{17DDDD3E-CD39-48B4-BE3F-71E550FCBBFC}"
    EndProject
    Global
    

    Don't forget to delete your old solution file! I have moved the solution file up one level

    0 讨论(0)
  • 2021-02-03 18:41

    Open solution explorer in Visual Studio and select the solution.
    Click on File > Save MyProject.sln As ...
    and choose the new location.

    0 讨论(0)
提交回复
热议问题