Understanding TFS Visual studio - visual-studio-2012

Since yesterday I am using the TFS of Visual Studio.
I have a webserver where I installed the TFS server with SQL Server 2012 express.
Everything is working perfectly but I do have 1 question.
I have created a workspace on my laptop which is then linked to a team project on TFS.
What do I do if my laptop crashes? Are my files of my workspace copied to the TFS server when you do a sign in in Visual studio?
Or do I need to use SVN repository like Tortoise to copy my projectfiles aside the TFS?

A workspace is a local working copy of the code. TFS will act as a code repository in the same way as SVN does.
you should be able to view the code that is checked in to TFS by using the source control viewer.
the basic process is
Create files in your local workspace
When you are happy commit them to TFS by using the check-in command
you can the edit / delete / add items to source control either by using the source control window, or the command line implementations.
you can find more information here http://msdn.microsoft.com/en-us/library/hh301771(v=vs.110).aspx#AddSource

Related

TFS Issue: Projects missing in the Source Control Explorer's left pane

i am having an issue in the TFS. I am able to login to my TFS account but i am not able to access any project and its files in my visual studio 2012. Also, the Folder pane on the left hand side in source control explorer is not loading any projects. Its blank.
What am i supposed to do?
Several things need to be checked:
Make sure your VS has the latest update installed (Requires latest Visual Studio 2012 update. Supports Git with Visual Studio Tools for Git extension.).
Make sure there are team projects under the Collection you connect.
Contact the administrator to see whether you have the permission to read the project.

How can TFS track changes but the solution not yet be bound to source control?

I cannot recall how we got this particular solution down from source control.
The current situation is:
When I explore the solution via "Source Control Explorer" I can see that it is mapped to a local workspace.
When I make changes to files within Visual Studio for the Solution, these changes show up under Pending Changes in Team Explorer.
I can check in these changes and they show up in the history for the solution.
BUT
When I right click on any file in Solution Explorer, I get the option Add Solution to Source Control...
If I choose this option, I get the message:
The item [blah.sln] is already under source control at the selected location....
I know I can fix the issue by selecting File > Source Control > Advanced > Change Source Control and then selecting each project in the solution and pushing the Bind button.
My question is:
How can TFS track changes but the solution not yet be bound to source control?
The source control bindings are stored in numerous places:
On the TFS Server your workspace configuration is kept. Whenever you connect to a TFS Project using Team Explorer your workspace mappings are retrieved and cached on your computer. So Visual Studio will know which folders are mapped to the TFS Server you're connected to.
In the local machine's workspace cache the workspace configuration is kept. This data is refreshed every time you connect to that TFS server. By default this is in you local appdata folder:
This workspace information contains your machine and user information as well as the server path mapping to a local path on your workstation. You can see this information by editing your workspace information in Visual studio:
In the workspace root the $tf folder keeps track of all files in case you're using a local workspace and Visual Studio can use these to detect changes. The Local Workspace was introduced with TFS 2012 and requires you to use Visual studio 2012 or newer, TFS 2012 or newer and to configure your workspace as Local (default for new workspaces in recent versions of Visual Studio).
In the workspace the files are marked read-only when checked in or writable when checked out when you're using a server workspace.
The above was make sure that even with no solution opened, you can use Source Control and check-in/out files.
In addition information is stored in the project file and solution to enable deeper integration in Visual Studio.
In your project file a number of Properties are added to indicate the project
is source controlled.
<PropertyGroup>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
In your solution file a number of Properties are added to indicate the project is source controlled.
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 2
SccEnterpriseProvider = {xxxxx}
SccTeamFoundationServer = http://some-other-guys-tfs-server/
SccLocalPath0 = .
SccProjectUniqueName1 = xxDemo\\xxDemo.csproj
SccProjectName1 = xxDemo
SccLocalPath1 = xxDemo
EndGlobalSection
In your case Visual Studio is relying on the first group of settings to interact with Source Control, but the second set is missing. Using the "Bind" option in the Change Sourcecontrol window will add the proper information to the solution and project files.
Since you're connected to a TFS server and the workspace mappings are synchronized to your system, Visual Studio knows that the folder containing your project is mapped to a TFS project using a workspace mapping.
This functionality is also useful when you're using another IDE that doesn't support TFVC at all, you can still use Visual Studio or the commandline to interact with TFS and operate on the workspace directly.

Git with Visual Studio Source Control Explorer available yet?

we set up Git as version control system (we used tfs before). Now the source control explorer is not available anymore.
I found this thread from 2013:
Using Git in Visual Studio, how do I navigate repository files?
It's 2015 now and I cannot find any info from late 2014 or 2015. Does anybody know something new?
Thanks
VS2015 still does not have a file browser for Git projects. They do have a list of *.sln files that can be opened within a Git repo. If you have say a "ReadMe.txt" at the root level of the repo though, you still need to open it in explorer or command line and modify it (either by adding to VS or elsewhere), then the file will show up in pending.
In VS2012, there was an add in called "Mindscape File Explorer" that added a file explorer. You could set the root directory to your projects folder and save you from leaving VisualStudio.
Apparently no one at Microsoft cares about solving this problem since it's been around for years now. Seems like it would be an easy win to just show all files at the project root level in either the solution tab or a new project view tab.
Visual Studio "15" Preview has an "Open Folder" feature that let's you load up any folder in the Solution Explorer but it's not connected with Source Control, you have to do it manually after you've connected with the repository in Team Explorer but it's better than nothing.
You can right-click the file to access History, Commit, Compare with unmodified, Undo, Go to git changes... etc

How to get latest or commit with TFS server from Windows Explorer?

My need
Currently I have to open Visual Studio to make a get latest or a commit pending changes.
I want to do that the same way with TortoiseSVN right in Windows Explorer.
What I have tried
I made google research and comes down to using the tool called TFS 2012 Power Tools
Someone also mentioned about this issue here
Though after installed, I got nothing working as espected. Wondering did I do wrong then...
I'm using Windows 8.1 and Visual Studio 2012 Web Express.
Question
How should I do to install it properly and get it work after all then?
Assuming that when you installed the power tools you enabled shell integration and then logged out/back in to active them, then you need to do a few things:
Do an initial 'get' from TFS using Visual Studio Team Explorer and make a note of your workspace folder.
In Windows Explorer, right click that workspace folder. You should see the context menu items appear.
Most people having trouble with the context menu appearing have forgotten that to log out and log back in, as Windows Explorer needs to be restarted to pick up the new shell extension.

How to migrate code to different Visual Studio Online project?

I have my Visual Studio C# source code inside Microsoft Azure - Visual Studio Online (VSO), which is basically Team Foundation Server (TFS) 2013 in a Cloud. The Project was created using Microsoft Visual Studio Scrum 2013.3 Process Template.
I need to change process template from current (Scrum) to native Microsoft Visual Studio Agile 2013.3 Process Template.
Currently I do have only source code inside VSO and need to preserve all versions/check ins, with date/times and owners for whole team, there are NO any work items (tasks, bugs etc.)
One solution is to open a new Project inside VSO with Agile template, however how to migrate my code? or how to make simple / easy changes to current VSO project to change process template?
Create a new project and branch your code to the new project. The old project must remain to maintain history
use the TFS Integration tools to replay history against the new location.
(recommended) Switch to Git and use Git-TF to pull the history into git.
check out the tip and check into the new project.
The only option here that adds future value is to move to Git. Once there your history will be forever portable.

Resources