How do you remove the bindings from a VS Team project, is it just a matter of deleting ".vspscc" files?
What is the best way to do this, say I have a project on CodePlex and it is time to package it up for release, but by default the bindings come with the source so when others open the solution it interferes with it.
The simple way to unbind from source control:
Open your project
File -> Source Control -> Change Source Control
Select your project(s)
Click "Unbind"
What worked for me (under TFS, not codeplex)
Copy or move the project folder out of your workspace (I put it in c:\temp), and then open it in VS2008.
Visual studio then shows the following prompt:
The solution appears to be under source control, but its binding information cannot be found. Because it is not possible to recover this missing information automatically, the projects whose bindings are missing will be treated as not under source control.
After this, another dialog appears, as follows:
The solution appears to be under source control, but its binding information cannot be found. Because it is not possible to recover this missing information automatically, the projects whose bindings are missing will be treated as not under source control.
And you can chose Temporarily work uncontrolled, or Permanently remove source control association bindings.
Select the latter, do a Save All, and reload the solution. Profit!
Related
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.
As per the tags, I'm using VS2013 and TFS2013.
There are multiple projects in the solution: Model, Presenter, View, etc. All other projects are working as expected in terms of source control operations.
Problems with the Model project:
Adding a new file via Solution Explorer isn't automatically detected as a pending change
Deleting a file isn't detected either
Other source control operations work fine for the Model project, such as:
Get latest version
Edit detection for existing files (including changes to the csproj
file when a new file is added)
Checking in pending changes
The csproj file would show up in pending changes with the newly added file listed in it, but the new file itself isn't showing up, therefore causing build errors on other developers' machines if only the csproj changes are checked in.
The workaround is to find the added file in solution explorer and Add via context menu, this will make it appear as a pending change. But this process should be automatic as per the other projects.
Noticed that there is no .vspscc file for the Model project while other projects have one each.
Any help appreciated. Thanks.
I would unbind and rebind the problem project and try again:
To unbind a solution or project from source control
In Visual Studio, open Solution Explorer and select a solution or
project to unbind.
On the File menu, click Source Control, then Change Source Control.
In the Change Source Control dialog box, click Unbind.
To bind a solution or project to source control
In Visual Studio, open Solution Explorer and select a solution or project to bind.
On the File menu, click Source Control, then Change Source Control.
In the Change Source Control dialog box, click Bind.
Select the database and location to which to bind, and click OK.
Click OK.
You might need to go to Advanced to find the Change Source Control option
https://msdn.microsoft.com/en-us/library/0eh3790h%28v=vs.90%29.aspx
Before unbinding and binding your solution try his:
Go to Source Control Explorer
Click the "Add Items to Folder" (the
one on the left of the red cross)
Select the items you want to Add and follow the instructions on screen
That's all
Click <Detected: x add(s), x delete(s)> : in the source control explorer then select the file to add
For years I've been relying on 'Detected Adds' to add missing files - which was never a sustainable solution but I've just about managed with it.
But now if broke.
I'm actually about to reinstall Windows but in the meantime one of the best ways I've found to get a sense on what's missing (and it's still working even though the detected adds isn't) is the recursive 'Compare' window.
You can add files from here too.
It's a little klunky but it gives me a good sense of security and shows file diffs if you want to see what may have changes.
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.
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.
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.