TFS 2010 Windows Shell Extensions, how do I connect to a workspace? - tfs

I have VS 2010 and a TFS 2010 server set up and it's all working fine. I've checked out files to my local hard drive.
I installed the TFS Power Tools to be able to get to TFS through context menu in Windows. If I right click in a TFS project on my hard drive I get all the icons and it works.
My question is that how do I get the TFS menu if I have no source code from TFS on my hard drive?
Regards,
Magnus

"how do I get the TFS menu if I have
no source code from TFS on my hard
drive?"
First, you need to define a workspace and map server (source control) paths to local directories. You can do this in either of two ways:
Use the tf workspace command to define a new workspace.
Use Source Control Explorer to Create a Workspace and Get Files.
Once you've setup your workspace, you can right click any file or folder in your workspace you will find a Team Foundation Server option, expand it and you will see other version control options like checkout, check-in etc.

Related

How to integrate TFS in WebStorm?

I'm using Git with WebStorm's version control already, but have to use TFS version control. After some research fond this plugin but there is no tutorial that aiming to configure that plugin.
Can anyone guide me?
You can opt for using git tfs, locally you can still use Git and all of the advantages you're used to. And then push from git to TFVC. You'll need to install Team Explorer or the Team Explorer Cross Platform Commandline Tools.
Or you can use the native plugin for, thelatest version of the TFS / Azure DevOps (Server) plugin can be found on the Jetbrains site. It requires TFS 2015 or newer. You can use the plugin you found for older versions of TFS.
A good explanation to get started can be found here. The part to configure TFVC is replicated below.
Visual Studio Team Services plugin and TFVC
Before starting with TFVC, we need an external tool. The tool in question is TF command line tool. It ships with the Microsoft Team Explorer Everywhere 2015 and you can download it here.
The file we are interested in is TEE-CLC-14.0.3.zip. Download it and unzip it in a folder of your choice. You should end up with something similar to this.
Now, open the command prompt, move into the folder where you have extracted the TF command line tool and run the following:
tf eula /accept
If command succeeded and you haven’t received any error, you are good to go.
Now back to IDEA. Open the settings panel.
and move to Version Control -> TFVC pane. In the select path to executable field, enter the exact path to the tf.cmd command file located in TF command line tool folder.
Once done, press the test button and you should see the following message
Confirm all of the open windows and get back to the IDEA welcome page. Now you are ready to choose Team Services TFVC (Preview) version control.
At this point, same as for Git, you will be prompted about the connection towards your TFS. The following dialog will be shown.
Move to the Team Foundation Server tab and specify the address of your TFS server, then click connect. You will now be prompted for the credentials and if everything is ok, you will be shown the list of available TFVC repositories.
You can now create a new workspace directly from IDEA and start working with your TFVC repositories.

Getting TFSBuild.proj from TFS 2008 to work on TFS 2012

I just copied my Solution from TFS 2008 to TFS 2012. In TFS 2008 the TFSBuild.proj does the normal solution building, calls installshield projects, dotfuscator projects and dumps the resulting installshield output in the drop folder.
In my Build Definition I set the "Items to Build" to point to the .proj file. The build works, but all I get is one folder with the logs inside. I added the .sln to build (although didn't need to previously) and get the .sln files built but installshield and dotfuscator are not done.
Looking at the .proj log file... None of my "Message" outputs are there. Was there some large change between these two versions that would necessitate a big change in the proj file?
I do not have admin rights to the TFS servers.
thanks
I'm guessing that you are using the "Default" build process template. You need to use the "Upgrade" template if you want to use a TFSbuild.proj file.
Edit your build definition and go to the "Process" tab. There should be an area that shows which template you are using. Click on the "show details" button and choose the "Upgrade Template" from the drop down list.
Now point the build at the folder containing the TFSbuild.proj and save the definition. This should solve the problem.

Why does "tf history ." claim there is no working folder in my mapped TFS directory?

I am trying to modify my project so that on build it queries for the current TFS changeset for the local directory and uses that to form the build number (using http://florent.clairambault.fr/insert-svn-version-and-build-number-in-your-c-assemblyinfo-file as a reference).
Since we currently are not using team build or any continuous integration for this particular project at this time I plan to use:
tf history . /r /noprompt /stopafter:1 /version:W
However, when I test this command out using the visual studio command prompt in my project's directly (where I work from TFS) it claims:
There is no working folder mapping for xxxxxxxx
The folder is shown as mapped in my workspaces in Visual Studio's Source Control Explorer (shows as the local path), and when I edit my workspace.
Why is the command line utility claiming there is no working folder when it is?
You will see this error message if you are using Visual Studio 2012 (and the corresponding Team Explorer 2012 client) and you are using tf.exe from Team Explorer 2010.
TFS 2010 clients store their local workspace cache in a different location on-disk than TFS 2012 clients. Thus, if you are to create a workspace with a TFS 2012 client, the TFS 2010 client cannot see that workspace data until it has connected to the server and populated its own local client cache.
It sounds like you're okay with using the TFS 2012 version of tf.exe, so I would make sure that your PATH contains an entry to that one first, and this should resolve your problem.
If you really wanted interoperability between the two versions, you would need to make sure to connect to your TFS server from both clients in order to make sure the workspace cache was complete for both. However make sure that you are using only server workspaces in this case, as TFS 2010 cannot connect to a TFS 2012 local workspace.

Can't remove workspace from TFS

I want to add my project from Visual Studio 2012 to my TFS server, but it says the path is already mapped for workspace pc;administrator (this is a local workspace).
I have tried the command tool tf but it says that there are no workspaces, so I can't delete the workspace that is conflicting.
I'm running Windows 8 with Visual Studio 2012. TFS is on a windows server 2012.
The problem is that the current project location, the folder on your physical machine, is mapped to a different TFS server. To add it to source control you need to move it to a physical location not associated with a TFS server.
Edit
To remove the offending workspace:
1) Use the "Team" menu to connect to the TFS Server that you do NOT want to be mapped to
2) Use ctrl+q --> workspaces to access the workspaces menu
3) Remove the workspace
4) Change to the TFS Server you WANT to be mapped to using the "Team" menu again
5) ctrl+q --> workspaces
6) Add a new workspace
Try any of these steps out. Some of them may not be applicable to you.
To clear up "cached workspace" and remove workspace mapping.
On Control Panel > User > Credential Manager
Remove Windows Account and Generic Account that points to TFS.
How can I change the default credentials used to connect to Visual Studio Online (TFSPreview) when loading Visual Studio up?
On IE, remove cached password.
http://www.jayway.com/2012/12/17/changing-tfs-credentials-in-visual-studio-2012/
Remove stored username/password:
http://blogs.msdn.com/b/visualstudioalm/archive/2012/08/29/clearing-the-credentials-for-connecting-to-a-team-foundation-server.aspx
rundll32.exe keymgr.dll,KRShowKeyMgr
Delete workspace. On VS2012 command line, run the following:
tf.exe workspace /delete workspacename;owner /server:serveraddress
http://mycomputeradventures.blogspot.com/2012/01/removing-tfs-workspaces-from-old-users.html
Clear Up cached workspace mapping. On VS2012 command line, run the following:
tf.exe workspaces /remove:* (or /s:http//oldserver:8080)
http://blogs.msdn.com/b/buckh/archive/2006/09/12/path-is-already-mapped-in-workspace.aspx
if you use Visual studio 2012 go
C:\Users{UserName}\AppData\Local\Microsoft\Team Foundation\4.0\Cache
or if it is Visual studio 2013 go
C:\Users{UserName}\AppData\Local\Microsoft\Team Foundation\5.0\Cache
Remove all things under it.
Simplest way to do this is to go to your AppData and delete the TFS cache (depending on the version 3.0 or 4.0)
C:\Users{UserName}\AppData\Local\Microsoft\Team Foundation\3.0\Cache
or
C:\Users{UserName}\AppData\Local\Microsoft\Team Foundation\4.0\Cache
First we will check the list of workspaces from VS 2015 Developer command prompt,
Ex - tf workspaces /owner:*
Now we will get the xml format from VS 2017 Developer command prompt which will have ‘owner id’ for the particular workspace,
Example 1 - tf.exe workspaces /owner:* /computer:ComputerName
/collection:https://YOUR-TFS-URL.visualstudio.com /format:xml
We can now delete the workspace for the particular user,
Example 1- Tf workspace /delete ComputerName;email#email.com
/server:"https://URL.visualstudio.com"
OR
Example 2 - Tf workspace /delete ComputerName;1e178c77-bb8b-6f05-bf99
/server:https://URL.visualstudio.com
(Where 1e178c77-bb8b-6f05-bf99 is ID of the workspace which you get from Step 2 XML
format)
Again we will check the list of workspaces from VS 2015 Developer command prompt,
Ex - tf workspaces /owner:*
Well I couldnt find my troublesome workspace, which prompted me to copy the local code folder into another name and I created a new workspace mapping that folder.
Next up I added the new solution to the TFS via VS 2012 using Add Source Control.

How to programmatically detect deleted files?

In Team Foundation, you can ask Team Explorer to show deleted files by doing this:
Tools > Options > Source Control >
Visual Team Foundation Server > Show
deleted items in the Source Control
Explorer.
My question is how do you do the same thing programmatically?
I am developing a synchronisation tool, and I need to detected deleted files in TFS. Workspace.Get(...) returns only non-deleted files.
Any idea how I can achieve that?
Go to the Visual Studio folder in your start menu and start up a Visual Studio Command Prompt from the "Visual Studio Tools" subfolder.
The command you want to run is:
tf dir /server:myserver $/myproject /recursive /deleted
(where myserver and myproject are your server and project)
use "tf help" for general info, "tfs help dir" for more help on this command, or google on "tf.exe" for more info.
The VersionControlServer.QueryHistory API will give you access to the changesets which will contain all version control operations including deletes.

Resources