How can I connect to on-premises TFS using Visual Studio Code? Is that possible the same way as in Visual Studio?
If you need to use Git, all you need is Visual Studio Code. Git is a built-in feature.
In order to also use TFVC you'll need to install an extension. You'll need Visual Studio Code and the Azure Repos Extension and a recent version of Team explorer and/or Team Explorer Command Line Client.
To edit Azure Pipelines (available in Azure DevOps Server 2019), you'll need to also install this Azure Pipelines extension.
The naming is a bit confusing, but these Azure DevOps extension also work with recent version of Team Foundation Server and Azure DevOps Server (new name).
First you need to install the official Azure DevOps Extension for Visual Studio Code which released by Microsoft.
It supports both TFVC and GIT version control type.
Clone your Git repository
With Git, the extension uses the remote origin of your repository to
determine how to connect to Team Services (or your Team Foundation
Server), in most cases you will need to have a Git repository already
cloned locally. If you intend on cloning an existing repository, do so
before proceeding. If you do not have a Git repository cloned locally
but already have a Team Services account (or a Team Foundation Server
instance), you may create a local repository (via git init) and once
you set the "origin" remote for that local repository, the extension
will detect the change to the remote and attempt to contact the Team
Services account (or Team Foundation Server).
Create your TFVC workspace
With TFVC, the extension uses information about the current workspace
to determine how to connect to Team Services (or your Team Foundation
Server). Workspaces can be created using the Visual Studio IDE,
Eclipse or with the JetBrains IDEs (e.g, Android Studio, IntelliJ).
Note: At this time, you will need to have a local TFVC workspace already available on your local machine. More information about the
difference between the two types (and how to determine which one
you're using) can be found here.
You could also take a look at below videos to help get you started using the extension quickly:
Set up the Team Services extension for Visual Studio Code - If
you haven't used the extension before, this video will show you how
to set it up, create a personal access token and get up and running.
Walkthrough of the Team Services extension for Visual Studio
Code - This is a walkthrough of most of the features of the Team
Services extension.
TFVC Source Code Control for Visual Studio Code - This video shows
you how to set up the TFVC support on Windows and demonstrates much
of the functionality available for Team Foundation Version Control.
Above is for Windows machine, if you are working on Mac, please take a look at this answer.
Note:
VS Code will leverage your machine's Git installation, so you need to install Git first before you get these features. Make sure you install at least version 2.0.0.
You need Team Foundation Server 2015 Update 2 or later.
Related
How to migrate a TFVC project from TFS to AZDO ?
Goal:
Is to migrate host projects on (TFS 2017) using TFVC, to switch them to Azure DevOps Service (AZDO) using TFVC there too.
My context:
TFS 2017 server version 2 hosting current source projects.
AZDO 2019 service wanting to host projects targeted on TFS.
Context wish:
Keep the history of source projects (TFS) on AZDO services.
I Just want to migrated the projects (TFS) in TFVC to (AZDO) in TFVC, without doing any TFVC -> GIT conversion.
I would like to avoid updating the TFS 2017 server for 2018 then to
the AZDO server to switch to AZDO services afterwards.
You understand
that is a lot of step to just want to switch a project in TFVC on
TFS2017 to a TFVC on AZDO
The easiest way to migrate is to upgrade your TFS2017 server to Azure Devops Server 2019 and then using the full fidelity import feature to upload your whole database backup to Azure Devops Service.
At the moment migration tools support TFS2018u3 as well as Azure Devops Server 2019 and 2019u1 as well as 2020 can be imported into the service. We do these kinds of imports regularly and it's a very straightforward process to restore your TFS server backup to a temporary SQL server, install the correct version of TFS/Ads and have it perform the upgrade in-place during the installation. Then use the migration tools to import the collection into Azure Devops Server. Depending on the size of your collection this may take between a couple of minutes to a couple of hours. I've done the upgrade on my laptop on certain occasions as well, installing Azure Devops Server and SQL Server Developer edition directly on Windows 10. Even a trial versions will do.
For all the details on the. Import process, see:
https://learn.microsoft.com/en-us/azure/devops/migrate/migration-import
If you want to import your tfvc project from one TFS servers to another TFS server/Azure Devops Server, you can detach the project collection on you current TFS server and bacmup/restore the database on another server. It will automatically be upgraded
If your project collection has multiple projects, you can delete the projects you don't need after attaching and upgrading your collection.
There are a few tools to perform a history replay from one server to another, those tools can't import everything, your changes id's will change and you'll lose the exact date a commit was made (and possibly the user who made the commit if that account no longer exists). Tools like:
https://www.opshub.com/products/opshub-visual-studio-migration-utility/
Depending on how old and how big your collection is, it may take many hours to migrate the data. If data has previously been deleted/destroyed or branched across projects or edited during branch operations, then the replay may fail or may be forced to perform alternative actions, some of these operations are no longer supported. I've used opshub on a couple of projects and some it completely failed to migrate, others migrated with incomplete or incorrect data. This was 4 years ago, maybe these were bugs and they were fixed, but since the import tools have been released we've used those almost exclusively.
PS: using tfs-git to convert (part of) your TFVC repo to git would be an alternative which I'd recommend you look into further. TFVC has been declared feature complete and has received very little love in the past few years. It's not supported by the new Multi-stage YAML pipelines, the integration for VS Code has been deprecated, the cross platform commandline tool for tfvc has been deprecated and therefore support for eclipse and rider and intellij as well. Team Explorer in VS 2019 is now pushed to the background with the release of the new git features which have escaped the Team Explorer window. It's clear that TFVC is fighting for a lost cause and that Git is winning, you'll need to switch over at some point.
I am trying to connect latest version (2019.3.4) of Rider to TFS (on premise, TFS 2010).
I went through the steps in their community support (https://rider-support.jetbrains.com/hc/en-us/articles/360000335099-How-to-use-Visual-Studio-s-TFV%D0%A1-local-workspace-in-Rider), and got stuck on the step #6.
Go to VCS -> TFVS -> Manage Workspaces, select your server, and press "Reload workspaces"
I am getting the following error when clicking reload:
If I try to click 'Edit' button, I get a different error:
When I try to view file history, I get this warning
13:50 Problems while loading file history: HTTP 401 Unauthorized
Rider never asked me to authenticate with my VCS (and I see no way of doing that).
What should I do to make it work?
Thanks
The documentation you refer to is using Visual Studio's TFVС local workspace, while TFS 2010 only supports Server workspace. Local & server workspace:
https://learn.microsoft.com/en-us/azure/devops/repos/tfvc/decide-between-using-local-server-workspace?view=azure-devops
Azure DevOps plugin supports working with Git and TFVC repositories on Azure DevOps Services or Team Foundation Server (TFS) 2015+, and support Local workspace only.
So, the answer by Cece is helpful, but does not solve the problem.
It simply turned out that I need a different plugin to Rider.
The one installed by default in recent releases is for Azure DevOps.
There is another one, called TFS - and that's the one to use.
https://plugins.jetbrains.com/plugin/4578-tfs/
We have a Team Project we created in 2013. The web site of the project allows Git Repos to be created, but in Visual Studio 2017 the Git repos we created are always Offline and exhibiting other odd behaviors (loading TFVC's interface in Visual Studio even when connecting to a Git repo within it for example). I used Fiddler to check out the traffic and noticed that this particular project is missing the SourceControlGitEnabled = true flag. A project we created a year and a half later DOES include the SourceControlGitEnabled flag and works properly.
Is there a TFS Team Project setting we can alter/enable or do I have to create a new Project with Git as the repo and migrate everything to it?
When you create a new repo in the Team Project in TFS2013, there should be a warning as below:
Note that some versions of Visual Studio will only provide full Team
Explorer integration with a repository that has the same name as the
team project. Users may need to manually clone this new repository to
use it in Visual Studio.
This maybe the limitation of TFS2013 with GIT, either manually clone this new repository to use it in Visual Studio or create a new Project with Git as the repo and migrate everything to it, both should be work.
I've installed the prerequisite (Team Explorer 2013) to the best of my knowledge, but when I try to set up a VCS root to connect to our TFS Version Control server, I continue to get this error message:
"No TFS assemblies were found on the system. Please make sure you have
Microsoft Team Explorer installed. Supported versions: 2015 2013 2012
2010 2008 2005"
The Team Explorer I downloaded from Microsoft just seemed to be a plugin for Visual Studio, which doesn't make much sense as a server-side component. Anyway, I configured a connection to our TFS box within Team Explorer/Visual Studio on my TeamCity server.
So I have two questions that seem to be undocumented by JetBrains:
What does it mean to set up and configure Team Explorer? How can I validate that I have set up and configured Team Explorer on my TeamCity server correctly?
How does TeamCity know how to find the Team Explorer assemblies? Is there some sort of configuration I am supposed to do? Where is this documented?
I guess I'm looking for a true step-by-step set of instructions that make no assumptions about my understanding of TFS or Team Explorer, or any assumptions about what I may have already installed on my TeamCity box.
I've read the two articles on the JetBrains site regarding how to set this up, and they don't cover actually installing and configuring the prerequisites or configuring TeamCity to discover the Team Explorer assemblies it needs.
Team Explorer is the client software that you use to access Visual Studio Team Foundation Server functionality from Visual Studio. You can simply launch Team Explorer on your TeamCity server to create a team project and check in a project, to validate whether it is installed correctly.
I couldn't find any documentation that mentioned how does TeamCity find Team Explorer assemblies. But, based on my understanding, there is no configuration needed to detect Team Explorer. Please make sure your TeamCity server is running under Windows.
If the issue that can't find Team Explorer persists, you can install VS Premium instead of Team Explorer.
Setting up Jetbrains TeamCity for CI with Team Foundation Server:
Install Jetbrains TeamCity
If you are planning on using IIS or TFS on the same server, configure Jetbrains TeamCity to run on a port other than 80 or 8080
Once TeamCity is up and running, you can begin configuring your TeamCity installation for CI Builds.
Log into TeamCity with your user name and password
Create a new TeamCity Project
Create a new build configuration
You will now see a series of build configuration settings that you will have to complete presented in a Wizard-style navigation view.
Enter General Settings
Enter VCS Settings
After entering VCS Settings, Create and attach new VCS Root
Enter the relevant information for your TFS instance
Create a Build Step using Visual Studio as your build runner. You can create as many build steps as you need and specify the order of the steps (similar to a TFS Build Workflow).
For setting up Continuous Integration builds, you will need to specify a Build Trigger. CI Builds will generally use a VCS Trigger that is triggered on each source control check-in.
If you need to pass any parameters to your build, you can configure these in your Build Parameters.
That is all! You can then either run your Builds manually by clicking on the Run button in TeamCity or simply verify that your builds are triggered by the next check-in into TFS.
NOTE: This question was asked before the release of git support in the TFS Service, and this works quite well now. Read more about using tfs service with monodevelop here: http://sviluppomobile.blogspot.se/2013/02/how-to-use-team-foundation-service-with.html
We decided to try out Team Foundation Service (the TFS cloud version) because it has Git support which would (we hoped) help us manage both our VisualStudio and MonoDevelop code in one place.
The question is how to connect to the TFS service in MonoDevelop? From what I can see, I should use HTTPS protocol, for server I just type the name of our TFS service, and for user I type in my live id user#live.com and try to connect.
The problem is the url which becomes something like this
https://user#live.com#projectname.visualstudio.com/
Note the two # signs in the url. Seems that whatever git Tools are used behind MonoDevelop barfs on that:
NGit.Api.Errors.JGitInternalException: Exception caught during execution of fetch command ---> NGit.Errors.NotSupportedException: Invalid URL
If I try to omit the user name from the dialog, I get another error about unauthorized access.
Is there a way to enter/store git username and password somewhere on the mac or in MonoDevelop? I'm pretty sure this would work eventually.
Team Foundation Service (tfs.visualstudio.com, formerly tfspreview.com) does not host git repositories, only Team Foundation Server repositories.
It sounds like you may be conflating two different concepts:
Codeplex, Microsoft's hosting site for open source software, does support both TFS and git hosting, as well as Mercurial.
Microsoft recently announced the git-tf project that allows you to create a local git repository that tracks a remote Team Foundation Server repository.
git-tf was designed with cross-platform users in mind, who use an IDE that does not have native support for Team Foundation Server source code control. It sounds like using git-tf would probably be the most applicable for you.