I need a way to add bindings to my VS2015 solution from the command line. In the GUI, the way this is done is File->Source Control->Advanced->Change Source Control. Then I would select the items that are not connected to my TFS server, hit OK, and Save All. The solution then has the items I want added to the bindings.
What I need is a way to do this same operation from the command line if possible? Thanks.
You can't change source control bindings through a TFS command simply.
However, as a workaroud you can delete the .suo next to the .sln file, and then opened the .sln file in Notepad and deleted this entire section:
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 2
SccEnterpriseProvider = {xxxxx}
SccTeamFoundationServer = http://some-other-guys-tfs-server/
SccLocalPath0 = .
SccProjectUniqueName1 = xxDemo\\xxDemo.csproj
SccProjectName1 = xxDemo
SccLocalPath1 = xxDemo
EndGlobalSection
Save the .sln in Notepad and then open in Visual Studio.
More details please refer Matt Frear's answer in this question How can I completely remove TFS Bindings
Update
No, you also can't do this through command Line to add bindings.
TF.exe are version control commands. You may have to manually rebind it in VS.
On the File menu, click Source Control, and then click Change Source Control. In Change Source Control dialog box, click Bind.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With