Using VS2013 and VS2010 with TFS2010 - visual-studio-2010

We currently have TFS 2010 and mostly work with VS2010. We're gradually starting to use VS2013 with the Express version.
How come when I open the Source Control Explorer in VS2013, everything shows as "Not Mapped" even though it IS mapped? When I try to map something, it gives me "The path X is already mapped in workspace Y"
I can't open anything from the Source Control Explorer since it prompts to map, but I manually open the project from the local folder, and see the little lock and + symbols in the solution explorer. I can even do check-ins and undos.

Check that source control explorer is connected to the same workspace as VS2010 by looking at the workspace drop down at the top of SCE. If your VS2010 workspace is a server workspace, and you created a new local workspace in VS2013 you'll see two workspace names showing.
Also, when you open an existing solution in Visual Studio, if that solution is in a workspace different than the one source control explorer is currently showing, SCE doesn't switch over automatically. You have to do it manually, again via that workspace drop down.

Related

TFS Map Team Projects to different folders

I'm using the TFS Server offered by Visual Studio Online and Visual Studio 2013.
I've mapped the DefaultCollection to C:\Users\xy\Source\TFS and the first Team Project TP1 to C:\Users\xy\Source\TFS\TP1.
Now I have a second Team Project TP2 which would automatically be mapped to C:\Users\xy\Source\TFS\TP2. Is it possible to change the path for TP2 to a completely different folder?
Yes, this is possible, but not really straight-forward. I'd advise to have a clean workspace without any pending changes, especially in the team project that you want to map differently.
Open Source Control Explorer.
In the toolbar of the window you can see a drop down box with your workspace. Choose Workspaces....
Select your workspace and click Edit....
The dialog contains a grid Working folders that you can use to add special mappings. A picker dialog for the TFS side and the local file system structure support you in this task.
Leave all the dialogs with Ok.

Visual Studio 2010 source control disappearing from Solution Explorer

Symptoms
When I open a certain WPF solution in Visual Studio 2010, after the solution loads and is displayed in Solution Explorer, for a moment, I see the source control icons (locks, checkout checks, etc) next to the items in the solution and then they disappear, except for check marks for checked out files. Right clicking any of the items without an icon shows a context menu without any of the source control actions. The checked items can be checked in and then the source control actions disappear for them too. If I open the Change Source Control dialog, the solution and all of the projects have the red line under them indicating they are invalid.
I can unbind each of them, then rebind them to the exact same Server Name and Server Binding successfully. This causes solution explorer to temporarily become source control-enabled again. But if I click the refresh button on solution explorer, I get a dialog stating:
An error occurred while accessing the source control system. Do you want to disable source control for this session.
This causes the solution explorer to lose source control interoperability again.
Yesterday, I tried to download the latest of a different solution that I had update on another machine. I found that somehow the new files I had added to the solution on the other machine were not in TFS. So I excluded them from the project and re-included them to add them to TFS. Then on my machine did Get Latest again. The solution updated so it knew the files should be included but it didn't download the files themselves. I tired Get Latest with Replace files even if the local version matches the server version and they still didn't download. I had to specifically get each file from Source Control Explorer. This may be unrelated but I wanted to include it in case it's not.
What I've Tried
To try to solve the first problem, I reset all VS settings and restarted. This didn't work so I shut it down. I uninstalled TFS Power Tools and that didn't work either. I replaced my .sln and .vssscc with the latest from TFS. I unselected TFS as the source control plug-in and reselected it. Uninstalled the NuGet Package Manager extensions, which also did not help. I don't have any add-ins and the only extensions I have installed now are a few Telerik control extensions, which are not new.
Why are the source control bindings becoming invalid?
Delete the .vssscc file and let Visuasl Studio recreate it when it reloads the project solution.
Try file » source control » change source control . Unbind and rebind .

How can I get TFS working again?

Today I checked out a new project in TFS (Visual Studio 2010): Which, if any, folders do I need to create before checking out a TFS project?
The .sln file wouldn't save (said it was read-only, and even when changing that in Windows Explorer, it made no difference).
So, I created a new folder, created a new .sln, and then copied all the other files over to that structure.
Now, somehow, TFS has "given up the ghost" On connecting (I do seem to connect, I can see the projects in the Team Explorer pane), when I 2-click the "Source Control" item below a project, I get, "Team Foundation Server is not your current Source Control plug-in. Click here to set the current Source Control plug-in."
If I do fall for its ploy, I then see, "Error Command "Tools.Options" does not accept arguments or switches."
What in blue blazes is going on?!?
I reinstalled ("repaired", as that was the only option other than uninstall) MSSCCIProvider, but that did no good - I get the same errors. How can I get TFS back?
UPDATE
I am connecting to TFS, because when I open VS and select the "Connect to TFS" (verbiage?) link, it opens the Team Explorer tab, with a visual representation of the TFS server, with the various "areas" below that, and then, for the area I'm currently working on:
Handheld
> Work Items
Reports
> Builds
Source Control
...but when I mash "Source Control," it tells me, "TFS is not your current Source Control plug-in. Click here to set the current Source Control plug-in."
But that's a bait-and-switch, because when I do (click there), I get the err msg, "Error< crlf > Command "Tools.Options" does not accept arguments or switches."
As per my comment, it looks like you have the wrong source control plugin enabled in Visual Studio. In visual studio go to "Tools", "Options", "Source Control"
Make sure that the "Current source control plug-in" is set to "Visual Studio Team Foundation Server"
You should now be able to use Team Explorer to manage your code in TFS

MS Visual Studio.net - saved source files missing after reboot

The other day I created a MS visual studio 2010 C# project and started coding. I saved the source frequently, but I did not select a destination to save to (just pressed ctrl+s and assumed the source was being saved). However I had to run and threw my laptop in my backpack on sleep. Unfortunately this laptop (acer aspire 5252 fyi) battery drains extremely quickly when on sleep, and eventually my computer shut off. Now I can't find my source files anywhere and I'm going crazy because I know I saved it and it's several days worth of work.
I tried doing a windows search but couldn't find the project files. I also did a little experiment - I created a new project and without saving the entire solution, I pressed ctrl+s on the source files. Save was successful, but I cannot even find the file that's open in the IDE. Even the "open containing folder option" is grayed out (see screen shot).
I really need these source files back. Obviously it's because I didn't save the solution that the source got wiped out, but where do the source files get saved temporarily before the solution is saved?
Thanks.
You are using Visual Studio's support for temporary projects. Nice feature for quicky test projects (and SO answers) but not a great way to ensure that your projects are still there after VS quits. Programming without source control is similarly inadvisable.
Tools + Options, Projects and Solutions, General. Ensure that the "Save new projects when created" option is ticked to minimize the odds that you'll forget to pick a solution folder. Triple-check that creating a new project now gives you a "Location" property in the dialog.
There is a default location for projects to be saved. That is probably where your files went.
In Visual Studio, on the menu, click Tools > Options > Projects and Solutions > General. There is a "Visual Studio projects location".
On my Windows 7 machine, the folder for Visual Studio 2010 is
C:\Users\<username>\Documents\Visual Studio 2010\Projects
Your unnamed project is probably saved with a default name like WebSite1.
If you would like to change that default location, here is some information on how to do that.
Visual Studio temporary projects are normally found in *C:\Users\"User Name"\AppData\Local\Temporary Projects* . It is a temporary folder that is deleted as soon as Visual Studio starts up.
How to save a Temporay Project from above link:
To save a temporary project
In Solution Explorer, choose the solution or project that you want to save.
On the menu bar, choose File, Save or Save As.
The Save Project dialog box opens.
In the , Name box, specify a name for the project.
In the Location box, specify where you want to save the project.
Select the Create directory for Solution check box.
Note: This check box is not available for Visual Basic web projects, Visual C# web projects, or other directory-based projects.
In the New Solution Name box, specify a name that differs from the project name.
Select the Add to Source Control check box if you want to add the solution to a version-control database or repository.
Choose the OK button.

How to add TFS bindings to a Visual Studio 2010 project?

There's a question already discussing how to add project/solution bindings to TFS, however it seems to only apply to Visual Studio 2008 (I am unable to find the "Change Source Control" dialog in VS2010).
I have a solution and source code on my local machine already in TFS, however it does not have TFS bindings (the thing that produces the padlock icon in the Visual Studio Solution Explorer and allows automatic checkout).
How can I add bindings to an existing TFS project using Visual Studio 2010?
In VS2010 check Tools>Options>Source Control and see if set to TFS. If not that might be why you don't see File->Source Control->Change Source Control.
I ran into this problem and, for me, the issue was that my solution was offline with respect to TFS. Upon trying to change source control, I received a message stating that it is already associated with source control but is offline. I placed the solution on-line, per my recollection, using the File->Source Control->Go Online menu option and this seemed to fix the problem.
Go to the source control explorer under Team Explorer, where you can see your repository. Right click on the top folder that maps to the folder on your local machine. There's an option called "Map to local folder". Map this to the folder on your local machine. This will set up all the bindings for TFS for your project.
I had the same problem and the following steps solved it for me in VS 2008.
Unfortunately, I didn't record the exact steps and don't want to add a new project to our TFS to try again, so the steps are from memory.
Go to File Menu -> Source Control -> Open from source control
Select solution file from TFS hierarchy
Accept any warning about project already being on local disc
A popup dialog comes up saying something along the lines "This solution is already under source control, but no bindings exist. Do you want to add them?"
A selector shows all projects in a grid and allows adding the required bindings. Add TFS server setting to each project (select all lines in grid at once and press a button at the top. I can't remember what it was called, but it was fairly obvious).

Resources