Visual Studio Solutions and Branches
Moderator: SourceGear
Visual Studio Solutions and Branches
It is currently my understanding that solutions won't merge across different branches.
Assuming that I have three branches, Development, Staging and Production would I have to create and manage the same solutions in each branch because solutions contain specific information related to its projects location in source control?
Additionally for example when adding a new project under a solution in the development branch or alternatively creating a new solution in the development branch would I have to then go off and make those same changes (adding/solution creation) in the staging branches manually once I've checked in the solution files and merged the development branch back into the staging branch?
Thanks,
Daven Patel
Assuming that I have three branches, Development, Staging and Production would I have to create and manage the same solutions in each branch because solutions contain specific information related to its projects location in source control?
Additionally for example when adding a new project under a solution in the development branch or alternatively creating a new solution in the development branch would I have to then go off and make those same changes (adding/solution creation) in the staging branches manually once I've checked in the solution files and merged the development branch back into the staging branch?
Thanks,
Daven Patel
Re: Visual Studio Solutions and Branches
Is there somewhere on our forums where you read this? There may be special cases where someone ran into this.It is currently my understanding that solutions won't merge across different branches.
If you added a new project to a solution, you should be able to merge it into its trunk or branch.
Are you trying to merge solutions or solution files? What kinds of problems/errors have you run into?
Linda Bauer
SourceGear
Technical Support Manager
SourceGear
Technical Support Manager
Re: Visual Studio Solutions and Branches
You won't need to worry about the .sln not being mergeable.
You will branch, then perform a fresh Open from Vault (or Open from Source Control) on the branch. Do whatever you need to the branch, including adding additional projects and check in your changes. Then close Visual Studio and perform the merge branches. Your .sln file will be listed as not mergeable. That's ok. Just continue through the merge and ignore the .sln file. When finished, check in your merged changes.
After the merge, go to your original location and perform a Get to get the new projects to disk. Then open your original project in VS using either recent links or double-clicking on the solution file on disk. You will be asked if you want to load the added project. Just say yes and VS will take care of the rest.
If you would like to run a test before trying it on your live project, you could use your Vault client and connect to our demo server if you are on the latest version. Information on our demo server can be found here: http://www.sourcegear.com/vault/demo.html. There's already some test projects in the Main repository that you can play with, or you can create your own test project and add it.
You will branch, then perform a fresh Open from Vault (or Open from Source Control) on the branch. Do whatever you need to the branch, including adding additional projects and check in your changes. Then close Visual Studio and perform the merge branches. Your .sln file will be listed as not mergeable. That's ok. Just continue through the merge and ignore the .sln file. When finished, check in your merged changes.
After the merge, go to your original location and perform a Get to get the new projects to disk. Then open your original project in VS using either recent links or double-clicking on the solution file on disk. You will be asked if you want to load the added project. Just say yes and VS will take care of the rest.
If you would like to run a test before trying it on your live project, you could use your Vault client and connect to our demo server if you are on the latest version. Information on our demo server can be found here: http://www.sourcegear.com/vault/demo.html. There's already some test projects in the Main repository that you can play with, or you can create your own test project and add it.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Visual Studio Solutions and Branches
I just finished running a merge operation between the development and staging branch.
After looking at the file the solution file in the staging branch is still pointing to the projects contained in the development branch which means any work done on the solution contained within the staging branch would be done on code in the develpment branch.
Given this because the solutions are supposed to be pointing to projects within their respective branches would I have to create a similar solution in the staging branch so it references the staging projects instead of the development projects.
After looking at the file the solution file in the staging branch is still pointing to the projects contained in the development branch which means any work done on the solution contained within the staging branch would be done on code in the develpment branch.
Given this because the solutions are supposed to be pointing to projects within their respective branches would I have to create a similar solution in the staging branch so it references the staging projects instead of the development projects.
Re: Visual Studio Solutions and Branches
When I ran a test, I didn't get the same behavior.
Would you be willing for me to take a closer look at what is going on in your case? If so, could you send an email to support at sourcegear.com (attn: Beth) with a link to this forum thread?
Would you be willing for me to take a closer look at what is going on in your case? If so, could you send an email to support at sourcegear.com (attn: Beth) with a link to this forum thread?
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Visual Studio Solutions and Branches
For other users who might read this, here's what needs to happen when you branch a bound project.
1) Close VS.
2) Use the Vault GUI client to create the branch. You can allow the .sln to be branched.
3) Once the branch is checked in, open VS.
4) Go to File - Source Control - Open from Source Control (or Open from Vault).
5) Follow the wizard to open the branched project. It needs to be in a different folder than the original project.
6) The branch is now bound separate from the original project.
If the branched project fails to be opened this way the first time it is opened, it will use the old bindings. Each user needs to perform this the first time they open a project on their machine.
HS: 222331
1) Close VS.
2) Use the Vault GUI client to create the branch. You can allow the .sln to be branched.
3) Once the branch is checked in, open VS.
4) Go to File - Source Control - Open from Source Control (or Open from Vault).
5) Follow the wizard to open the branched project. It needs to be in a different folder than the original project.
6) The branch is now bound separate from the original project.
If the branched project fails to be opened this way the first time it is opened, it will use the old bindings. Each user needs to perform this the first time they open a project on their machine.
HS: 222331
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Visual Studio Solutions and Branches
Beth (and all),
I am under the same stuation as davenptl. I opened the branched solution from Vault (step 4 in your list) within Visual Studio, and as soon as the files loaded in the Solution Explorer, I could see that they corresponded to the trunk version of my project rather than the branch. I verified this when I opened them.
I looked at the bindings and I saw they pointed to the trunk (!!). I rebound to the branch and worked away for a while. When, later, I opened the trunk version, the bindings were pointed to the branch too. I got the impression that Vault mixes up the trunk and the branch inside Visual Studio.
I posted a question about this yesterday, here: http://support.sourcegear.com/viewtopic.php?f=5&t=16402.
I am under the same stuation as davenptl. I opened the branched solution from Vault (step 4 in your list) within Visual Studio, and as soon as the files loaded in the Solution Explorer, I could see that they corresponded to the trunk version of my project rather than the branch. I verified this when I opened them.
I looked at the bindings and I saw they pointed to the trunk (!!). I rebound to the branch and worked away for a while. When, later, I opened the trunk version, the bindings were pointed to the branch too. I got the impression that Vault mixes up the trunk and the branch inside Visual Studio.
I posted a question about this yesterday, here: http://support.sourcegear.com/viewtopic.php?f=5&t=16402.
Regards,
Cesar.
Cesar.
Re: Visual Studio Solutions and Branches
There's a response for you in the other thread you created: http://support.sourcegear.com/viewtopic.php?f=5&t=16402.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support