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.
Related
I want to migrate a lot of projects from Clear Case to TFS2015 via the "add to source control" option of VS2015.
I started out with this How to transfer a project from ClearCase to TFS? SO question and its answers.
This works out fine for most of the cases but in some cases the clear case reference seems undeletable. Whenever i go right click on my solution and want to add it to source control it gives me a clear case error "Project must be in a view". When i inspect File -> Sourcecontrol -> Change source control i can see no binding to clear case and when i first opened the solution i took the option "permanently remove all source control bindings from this project"
So my question is, are there any further references to a solutions/projects source control other than the "scc" nodes in the .proj files and how can i delete them so that i can add it to my TFS?
I just found the answer myself:
First: do the same thing you did with .proj files with the .sln and remove the entire globalsection about sourcecontrol.
Second: go in Visual Studio to Extras -> Options... -> Source Control and there change the plug in from clearcase to TFS.
Finally: profit
I didn't bother checking this before because like i said this occured randomly and I don't know why when i started to migrate the plug in was always selected as TFS and then, after some projects, changed to clearcase... anyways i will let this question up here for someone who may run into the same issue since i did not find very much online about this topic.
In my VS Professional 2013,I copied and pasted a solution from the source control workspace to my desktop but everytime I open the solution I get these messages:
The mappings for the solution could not be found.
The mappings for the solution could not be found.
The mappings for the solution could not be found.
The mappings for the solution could not be found.
The active solution has been temporarily disconnected from source control because the server is unavailable. To attempt to reconnect to source control, close and then re-open the solution when the server is available. If you want to connect this solution to another server, use the Change Source Control dialog.
How can I completely remove everything related to the TSF from the solution?
I already tried the following suggestions from answers in similar questions:
select the solution in the solution explorer, then go to the File menu. Under the file menu, you'll see a Source Control menu. Under that you'll see Change Source Control.Select this, and in the dialog box that comes up, choose "unbind."
Delete *.vssscc, *.vspscc, files . Open the .sln file with notepad and erase GlobalSection(TeamFoundationVersionControl) ... EndGlobalSection
There is a tool to remove Source Control Bindings from Visual Studio Solutions and Projects from msdn: http://blogs.msdn.com/b/saveenr/archive/2012/08/11/a-tool-to-remove-source-control-bindings-from-visual-studio-solutions-and-projects.aspx
How to use the tool:
•Copy your solution to a new directory (because the tool does modify files)
•Run this command: VSUnbindSourceControl.exe (ex. d:\yourfolder)
I had my solution in Visual Studio 2012 (which is under TFS source control) open and the TFS server (2010) was down. When I then made a change to one of the files and attempted to save it I got a prompt to ask whether I wanted to Overwrite the file saying the TFS server was down (can't remember the exact words) and the following message appeared in the Output window:
This solution is offline. [Team Foundation Server: http://tfs1:8080/tfs/server]
The solution was offline during its previous session and will remain offline.
How do I get the file change to be recognised as being among Pending Changes and the whole solution back online?
I searched for the solution online and found this solution but wasn't too keen on the registry change.
I found a better way: right-click on the solution name right at the top of the Solution Explorer and select the Go Online option. Clicking this allowed me to select the files that had been changed when I was offline and make the solution online again.
After finding the solution, I found the following msdn forum thread which confirmed the above.
Go to File > Source Control > Go Online, select the files you changed, and finish the process.
Rename the solution's corresponding .SUO file. The SUO file contains the TFS status (online/offline), amongst a host of other goodies.
Do this only if the "right-click on the solution name right at the top of the Solution Explorer and select the Go Online option" fails (because e.g. you installed VS2015 preview).
(Additional step from solution above for if you are missing the AutoReconnect or Offline registry value)
For Visual Studio 2015, Version 14
Turn off all VS instances
HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0\TeamFoundation\Instances{YourServerName}\Collections{TheCollectionName} (To get to this directory on Windows, hit the Windows + R key and search for "regedit")
Set both the Offline and AutoReconnect values to 0.
If you are missing one of those attributes (in my case I was missing AutoReconnect), right click and and create a new DWORD(32-bit) value with the desired missing name, AutoReconnect or Offline.
Again, make sure both values are set to zero.
Restart your solution
Additional info:
blog MSDN - When and how does my solution go offline?
I am using Visual Studio 2017 15.4.0 version. Especially when i started use lightweight solution option, this offline thing happened to me. I tried to above solutions which are:
Tried to regedit option but can not see appropriate menu options. Didn't work.
Right click on solution, there is go online option and
when i choose it that gives this error message: "The solution is
offline because its associated Team Foundation Server is offline.
Unable to determine the workspace for this solution."
Then from File -> Source Control -> Advanced -> Change Source Control. I saw my files. I select them and then chose bind option. That worked for me.
You can go use registry editor.
Turn off all VS instances.
Open registry editor and go to:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\TeamFoundation\Instances
Find proper server e.g: team32system1
Go to Collection and nex DefaultCollection:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\TeamFoundation\Instances\team32system1\Collections\DefaultCollection
Set Offline key to 0
Open solution in VS. Afterwards pop up should appear which question would you like bring solution to online mode.
Neither of the above solutions worked for me on Visual Studio Community 2017 v15.7.1. Somehow, there was no "Go Online" option in the context menu. I tried registry edit as suggested here, but that only displayed me error that it could not find the binding. What worked for me is rebinding solution to the server from Change Source Control menu.
Go to File->Source Control->Advanced->Change Source Control and make sure that your solution is binded to your source control. If not (like mine) then click on bind button, it will automatically search online TFS server and rebind your solution to it.
i found another way without much effort.
Just simply right click your solution and then click undo pending changes.
Next, VS will ask you for acutally changed file where you want to undo or not specific file.
In this you can click no for such a file where actual change is happende, rest is just undoing. This will not lost your actual changes
You will need to do two steps here for a complete solution
First click on the Solution that you have open and then go File-> Source Control -> Go Online Then uncheck all the files that are being shown as being modified while you were offline.
Don't do the Get Latest version from Source Control Explorer. That will result in a dialog potentially showing a bunch of files asking you to resolve conflicts. Instead do this
In source Control explorer right click on the folder you want to get latest of and then Advanced - Get Specific Version. In the dropdown for version type choose Latest and then choose the first check box that says Overwrite writable files that are not checked out. This will automatically bring your folder in sync with latest on the server
One method I did with mine, is to "Add to Source Control", and select 'Git'.
Why would my VS solution lose its TFS bindings suddenly? I have been working on a project for six months and this never happened. As soon as I opened a VS project/solution, I could check in/out, view history by right clicking on any given file. But suddenly, I dont see those options to checkin checkout etc any more when I right click on a file in VS studio solution explorer.
The team explorer window still brings up the source folder structure and I can get latest or get specific from there but did any one see this kind of behavior? Please let me know what I can do to avoid these situations in future.
Did you lose connection to the TFS server any time recently? I've had this happen in the past on unreliable network connections when working via TFS remotely. The solution and all projects therein would "go offline" and would appear to lose their bindings. This made it particularly unintuitive when the connection was re-established because changes made while "offline" weren't always found.
If you right-click on the solution or the projects, is there an option to "go online"? You might check the various menus for such an option as well.
Did you move the source files to a different location on your harddrive, or change your workspace mappings?
Try opening the solution/project by double-clicking the .sln file in Source Control Explorer instead of opening it from windows explorer.
You can also try bringing up the Bindings dialog by going File -> Source Control -> Change Source Control
I recently had a very similar experience. I had made several changes which I thought may have influenced my connection resilience. After reversing out of 2 of them and the problem persisted, I finally clocked what it was.
One of the new extensions I am using is NuGet (http://nuget.codeplex.com/). Every time I attempt to add a library my TFS connection fails and is unrecoverable till a restart of VS 2010.
See: http://nuget.codeplex.com/workitem/725
There is a work around that has been reported and working which may help you even if this is not your problem.
see http://blog.rthand.com/post/2011/08/26/Fixing-combination-of-NuGet-and-Team-Foundation-in-workgroup-configuration-401-Unauthorized.aspx
Happened to me also. I was removing a whole bunch of mappings for old releases under the local workspace. It was taking over 40 minutes so I killed it. The mapping has been removed to the older branches but the branch left behind had been disconnected from TFS.
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!