Change TFS collection of a Solution in Visual Studio 2010 - visual-studio

I am trying to setup TFS server for our Projects. I sucessfully setup and added one of the solution for testing to TFS source controls. But naming were test purposes only so i need to change it. I deleted TFS collections from administration panel and created a new one, but when try to add my solution to new collection it tries to connect old collection and -naturally- cannot find it, and raises error. I do not have same problem for other solutions but only for the solution i tested in the first time.
things I've tried.
file --> Source Control --> Change Source Control
Deleting all source control files in solution folder
Checked .sln file for references to old collection
Restart the computer.
edit:
Ok I have find solution to my problem.
The thing is Workspace info remained somewhere, I created a TPC and TP same name with the old ones. Then I manually removed Workspace info and then it worked.

You have to rebind the solution to the new collection using File -> Source Control -> Change Spurce Control. There you have to unbind all projects and rebind them to the new collection.

Ok I have find solution to my problem. The thing is Workspace info remained somewhere, I created a TPC and TP same name with the old ones. Then I manually removed Workspace info and then it worked.

Related

Remove TFS Bindings without a hack

I have a 2013 Visual Studio Web Project which was in source control. It has been detached for some time and now I want to move it to a completely new TFS server but when I do it errors and complains expecting certain folders to exist. I think this is due to the TFS bindings.
Now I have seen lots of posts about how to edit the solution file to remove the bindings, plus a few other steps but I'm wondering if there is a menu item which you can click to remove the bindings so I can point at a different TFS server? I am hoping I don't need to edit solution file.
I am not simply being lazy - but I want a defacto way of doing this correctly in one go, not hack here and hack there. Hacking a solution file from someone's advice is not the same as clicking a 'Microsoft' menu item.
Quite easy, you just need to follow my steps and you will get it worked.
Open your solution, for now its under source control with your old
TFS server.
Move to File -> Source Control -> Change Source Control , on the
pop-up window click the unbind, you can unbind all of the
solution or a specific project. Will get a below screenshot.
You can check the solution in solution explorer, there is no lock
icon which means not in source control any more.
However, this isn't over. Since your solution file is still in the
workspace which associate with the old TFS server. So if you want to
add the solution to new source control right now, you will get an
error:
" The item 'ConsoleApplication1.sln' is already under source control
at the selected location xxx"....
You have to copy this solution to a different place out of your
workspace. And change the connection of TFS to the new TFS
server(which you want to add source control with).
Finally, open the solution from local folder(new copied). Right
click the solution in solution explorer select "Add solution to
source control" and choose the location you want add to.

P4VS Source Control Binding Error On Startup

I'm developing a C# solution in Visual Studio 2013 under Perforce source control (P4VS plug-in). When I first load Visual Studio I can perform a connection to my perforce depot no problem. Then I select "Choose Solution/Project in Perforce Depot" to open my project...
This is where the fun starts. In the P4 file chooser window I can see my Depot (good) and I can navigate its directories (also good). However when I expand any of the directories I receive an error the Perforce Source Control output window. Say for example I expand the Depot root directory, I receive the following (error) message:
E_WARN: //depot/* - file(s) not in client view
And so on for every directory I expand.
Now there's even more fun when I open my solution file, I get the dreaded "Source Control - Unable to Access Database" warning dialog. It contains the following:
The associate source control plug-in is not installed or could not be initialized.
Temporarily work uncontrolled - Microsoft Visual Studio will attempt to reconnect the solution or project to source control after closing and reopening the solution
Work offline in disconnected mode (greyed out... I won't go into the detail)
Permanently remove source control association bindings
I select "Temporarily work uncontrolled" and the solution is loaded outside of Perforce source control. Not good.
Now in order to open the solution under source control I have to go to Tools -> Options -> Source Control and re-select P4VS as my source control plug-in and then reopen the same solution that I have open outside of source control. This works fine and I now have the solution open under Perforce Source Control.
My guess is this has SOMETHING to do with the source control bindings, however I haven't the slightest clue how to handle such a problem. As always all help is appreciated!
Sorry you ran into challenges. Often times the error:
E_WARN: //depot/* - file(s) not in client view
points to an issue with the client workspace configuration ('View' file map field) needing to be modified. Not enough details to know for sure if this is your exact issue with the Perforce client that is being used to manage the Visual Studio project. See 'Refining workspace views' under Configuring P4 in the Perforce User Guide.
In terms of bindings: Not sure if you used a previous source control, but if a project was used with another plugin (even P4SCC) you must first remove those source control bindings.
For reference, here are some step-by-step docs on using P4VS with Visual Studio with new or existing projects:
http://answers.perforce.com/articles/KB_Article/Create-New-VS-2010-Project-in-Perforce-using-P4VS
http://answers.perforce.com/articles/KB_Article/Add-VS-2010-Project-to-Perforce-using-P4VS
I hope this has been somewhat helpful. Perforce Support support#perforce.com can further assist you as well.
I'm still not sure as to why the
source control plug-in not installed or could not initialize
warning appears, however I've figured out the
E_WARN: //depot/* - file(s) not in client view
messages. It's due to some voids in my workspace mapping. My depot is under this structure...
//depot/sub/sub2/sub3/project_folder
whereas my workspace is configured as follows...
//workspace/project_folder
thus every time I navigated in visual studio through the perforce depot, looking for the project to open, any depot directories that didn't have a matching workspace directory posted this warning.
Makes sense, the files I was viewing in the depot were "not in client view", client being my client side P4V.
Hope this helps clarify part-way for anyone having a similar problem.

Visual Studio Project Files and Source Control Bindings

I am copying projects in one solution that is bound to VSS from one solution to another that is not bound (or shouldn't be). When I copy the original project and add it to the new solution, it's showing as checked in and VS is remapping the working folder in VSS; I want this new copy to not be bound to source control and not do the remapping. Is there anyway to disable it, even manually. I can edit the project file if I have to, but I'm not sure what to delete.
Thanks.
this is manual, but you can try this out:
http://weblogs.asp.net/bkcarroll/archive/2004/03/08/86059.aspx
basically tells you which files and lines to clear out.
You can also click File->Source Control->Change Source Control and unbind the project from SourceSafe.

How do I unmap a project?

How do I unmap a project in Team Foundation Server 2010?
I changed the location of a source control, and completely removed it from TFS source control. but now it is showing up wanting to add it:
Also, when I try to Map the new project, it is giving the error below. I've completely deleted the files off my local PC, and I'm wanting to map and get latest version from source control, but it gives an error trying to map. I'd rather not change the location. How do I remove the old binding and the project, when it was already deleted using TfsDeleteProject.exe?
You should be able to go to Workspaces and remove/add any mappings there directly.
Go To Source Control Explorer
Expand the Workspaces drop-down along the toolbar in the Source Control Explorer
Click the last entry to manage workspaces
There you should be able to remove mappings.
Here is an article discussing Workspaces
http://www.woodwardweb.com/teamprise/000334.html
I would like to add something to the accepted response...
If you have used some other credential to get code previously, then there would be a workspace already existing that would be mapped to the mentioned local folder. In that case the new credential can not be used to map the same server folder to the same local folder. You will first have to login with the older credential and delete that workspace and then you need to create a new workspace with your new ID and then map to the desired folder (which should now be unlocked) and you should be ready to go.

Adding a new project to an existing solution in TFS

I added a project to an existing solution that is currently under source control using TFS, but for some reason I cannot check in the new project. When I view my pending changes, none of the files in the new project show up. None of the files have a plus (for a new file) next to them. What did I do wrong? How do I fix it? It's time to check in.
The problem is the solution has lost its binding. That's why it's not checking out automatically when you add the new project.
In order to restore the binding in VS 2010, go to File->Source Control->Change Source Control. Look for the "Solution: your solution name" and if it's not bound it will say "no server". Click on it and then click "Bind" from the toolbar.
in Visual Studio 2012/2013 it's File->Source Control->Advanced->Change Source Control (Thanks to danglund).
This should create a new vssscc file that is correctly bound. Now add the new project and everything should work correctly.
I was also having the same problem, this is how I fixed it:
Go to Visual Studion: File->Source Control->Change Source Control
Find your project there, its status would be "Invalid", Click on it and press "Unbind". Now go back to Solution Explorer and Remove your project. Add this project again into the solution explorer solve the problem.
Good Luck!
Click on the Team Project name in Source Control Explorer
File -> Source Control -> Add Items to Folder...
Follow the wizard.
Head over to Source Control Explorer and browse to the place in the tree which matches where the new project is at for your solution. Add the files there.
However, I'd be concerned that you modified the solution file and it didn't ask you to check that out. What you may want to try doing is manually checking out the solution file, then readding the project to the solution and seeing if it takes then.
You shouldn't need to drop to the command line - this is a pretty straightforward operation.
Open the solution. Select the project (make sure it is in the solution).
File -> Source Control -> Properties will bring up the binding dialog.
Bind the project to source control.
You should now see + signs next to all your files. The key is that that a .vssscc is added for your project to version control.
If that fails, open your csproj in notepad (after making a backup), and ensure any version control bindings are removed, then try again.
Unfortunately, I'd wager that your best bet is to manually do the check-ins through the command line. I've ran into situations where the Team Explorer UI grows out of sync with what's actually happening in source control, and manually fixing things through tf.exe was the only way to resolve it.
That said, normally, adding a new project to a solution isn't a hassle.
TFS can simply do not know about your project existed. Just add your project files through Source Control Explorer and re-load the solution.
While loading of a solution it can ask you to bind your project to source control. Let it do so by clicking Bind button - it should do all the magic for you.
Make sure you get the latest version of the solution
Check out the solution file
Add the new project
If the newly added project was previously under (another) source control, that might mess things up, make sure to "unbind" it before adding it. (See source control bindings somewhere under the "file" menu in Visual Studio)
You shouldn't need the command line.
I had this same problem in VS 2019, where I had added a new project to an existing solution, and the project wasn't showing up in pending changes. Right-clicking on the project and going to Source Control only had an option to "Add Solution to Source Control".
Using the above answers, I started down the File --> Source Control path, which then yielded an option to directly "Add selected projects to source control". Taking that option solved the problem, so that now the new project shows up in pending changes. NOTE: I'm adding this answer since it's still an issue in VS 2019, but has an easier solution now than in the past.

Resources