Rider TFS integration - tfs

I'm attempting to setup an old project on a new computer using Rider with TFS. I'm already using TFS with the same repository on an old computer with Rider, however, I've noticed that on my new computer, TFS is no longer an option for version control. I have the plugin, I can go to version control under settings and view settings for TFS, but when I attempt to enable version control for the project, TFS is not an option. Similarly, I can't checkout from TFS.
Also, the settings screen for TFS is very different on my new computer's install, giving me only the options to delete and update configurations, but no way to add one (so I can't actually do anything). Any ideas about what's gone wrong here?

Have tested installing riderRS-171.4456.199.exe (Windows), the TFS Integration plugin has been bundled with Rider and enabled VCS-TFVC successfully. Seems you are using TFVC version control(check out), please follow below requirements:
You must have the TF command line tool installed to be able to
use TFVC features. The minimum version supported by the plugin is
14.0.3. To install the tool, download the latest "TEE-CLC-14...zip" file and extract it to a known location. After extracting the files,
you must accept the license agreement. To do so, open a Command
Prompt/Terminal window, navigate to the extracted directory, and run
tf eula. After reading the EULA, enter y enter code hereto accept
it. NOTE: If you forget to do this, the plugin may fail to load
with a RuntimeException.
For the tool to be detected by the plugin, you must set the location of the executable in the Settings/Preferences menu by following these instructions:
Go to RD Settings Version Control -TFVC
In the Path to tf executable text field, navigate to the location of
the tf executable.
Click Test to test that the executable has been found and is working
as expected.
Click Apply then OK to save and exit.
More details please refer this tutorial.
Also try to setup a new created project or select another project when you are using Rider with TFS. To narrow down if the issue is related to that special project.

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.

Project Rider TFVC Config

When setting up Project Rider TFS config I am getting below error. But path seems to be valid.
I have tested installing riderRS-171.4456.199.exe (Windows), the TFS Integration plugin has been bundled with Rider and enabled VCS-TFVC successfully.
However, the command line tool is not using the tf.exe under VS.
You must have the TF command line tool installed to be able to
use TFVC features. The minimum version supported by the plugin is
14.0.3. To install the tool, download the latest "TEE-CLC-14...zip" file and extract it to a known location. After extracting the files,
you must accept the license agreement. To do so, open a Command
Prompt/Terminal window, navigate to the extracted directory, and run
tf eula. After reading the EULA, enter y enter code hereto accept
it. NOTE: If you forget to do this, the plugin may fail to load
with a RuntimeException.
For the tool to be detected by the plugin, you must set the location of the executable in the Settings/Preferences menu by following these instructions:
Go to RD Settings Version Control -TFVC
In the Path to tf executable text field, navigate to the location of
the tf executable.
Click Test to test that the executable has been found and is working
as expected.
Click Apply then OK to save and exit.
Besides, if you intend to use the tf tools from the command line, you may want to add this folder to your PATH environment variable as well.
More details please refer this tutorial.

Commit file back to repository from build server in Visual Studio Team Services

I'm currently setting up continuous integration using TFS/Visual Studio Team Services (was VS Online), and I'm using the Team Foundation Build 2015 tasks. So not the XAML builds.
I'm using it to build a Xamarin Android project, but that's pretty irreverent I guess,
The process should be like this:
After a check-in:
TFS should download the sources
TFS should increment the version number within AndroidManifest.xml
I've managed to do this by making a PowerShell script for this.
After the AndroidManifest.xml file is modified, it should be committed back into the TFS repository
Then the rest, build deploy into hockeyapp etc
The first steps are all configured, but I'm struggling with the commit part. How do I get TFS to commit the file? I don't really see any task suitable for it. I've tried using the Copy and Publish Build Artifacts Utility - But that did not seem to work, and I'm not even sure if that's the right utility
I'm using the default hosted build agent btw. Any help would be appreciated
Warning
I do want to point out that checking in changes as part of the build can lead to some features of VSTS/TFS not working. Association of work items to the checkin, sources and symbol generation, tractability from changes to build to release and integration with Test Manager, remote debugging, will likely not yield the expected results because the Changeset/commit recorded in te build may not match the actual sources. This may lead to unexpected funny behavior.
Also, if any new changes have already been committed/checked-in after the build has started, the version number may be updated in Source Control for code that was not actually released under that version.
So: First of all, it's considered a bad practice to change the sources from the build process.
Alternatives
There are better ways of doing it, one is to use the build version (Build_BuildNumber or Build_BuildID variables). Alternatively you an use a task like GitVersion to generate the semantic version based on the branch and tag in your git repository. That way your build will generate the correct version number and will increment the revision in case the same sources are built multiple times.
I understand, but I still want to check in my code as part of the build
If these things don't work for you and you still want to check in the changes as part of the build, you can either use the TFVC Build Tasks if you're using TFVC or use the Git Build Tools to add the remote to the local repository and then use the git commandline tools to commit and push the changes back to the repository.
These extensions require TFS Update 2 to install. But you can push the individual build tasks using the tfx commandlien tool. For the TFVC tasks the process is explained here.
On mac
On the mac it's going to be harder since you're using TFVC. My TFVC tasks leverage the TFS Client Object Model and Powershell to communicate to the TFS Server. The tf.exe tool doesn't even work on windows when you're in the context of a build, which is why I need to call into the VersionControlServer object directly. Given I'm dependent on these technologies, the tasks won't run on a Mac or Linux agent.
You could try to see whether the Team explorer Everywhere X-platform commandline works from the build agent (using a shell script). I have no way to test this on an actual Mac.
Given the cross platform nature of your project I'd recommend to move to Git, it integrates into XCode and Android Studio, making it easier to do a native UI or build on top of native libraries.
Alternative 2
You could setup a build which does the required changes to the code and then checks in the modified code. Then have a (CI) build run the Android and the Mac builds using the modified code.

TFS plugin locks file on edit

Hi I am using MS TFS as my repository, i have tsf everywhere plugin installed on eclipse juno, here whenever I make an edit in a file, the file gets auto locked in repository and then only after I commit, another developer is able to commit, is there any way to avoid locking, as we have in SVN, i mean edit won't lock the file.
In your team project configuration, in "source control settings", you need to check "Enable multiple check-out". You also need to check in your team project collection settings if "file merging" is enabled for your file extensions.

TFS shelveset migration from one branch to another

I have to migrate the shelveset created in one branch say "development" to another say "release".
so that I can directly merge the shelveset then to release which was created for development branch.
the command I have used is:
tfpt unshelve "shelveset name" /migrate /source:"$...development" /target:"$...Release"
it is showing this error:
unable to determine the workspace
Your location from where you launch the command must be from within your workspace.
E.g. c:\workspaces\project\development if that's where your source is located.
I guess you question is: How can I get the job done without this error occurring?.
In that case, make sure both branches are mapped to your local system and a latest version of your source code in you did a get-latest-version.
That should prevent the error from happening, because the paths then both contain information about the workspace used for the mapping.
I ran into the same issue today.
After checking the items below I got it working:
Have only one Powertools installed.
Run the command from a Developer Command Prompt
Run the command from the folder that is mapped to your target workspace.
I had to uninstall v. 2010 so only v. 2012 remained. The version numbers doesn't seem to reference your TFS version.
To check if you are at the correct folder, you can run tf workspace.
In the window that pops up find the workspace that you want to target and check in column Local Folder. Make sure you are in that folder.
I spent good amount of time to get this done and I had few issues to overcome and one of these in fact was
unable to determine the workspace
This particular issue was solved by running the command from source branch root folder. This is contrary to some answers here and on SO in general where they say to use "target" branch - no, use "source":
cd [your !!source!! branch root]
tfpt unshelve /migrate /source:"$/MyCollection/Development/Maint1.1" /target:"$/MyCollection/Development/Maint1.2" "myShelveset;UserName"
Second issue appeared after this. Seem that it couldn't connect to TFS server. what I realized, I have multiple VS installed and connected to different TFS servers. I was using VS12 and I had workspace and server connection. But I didn't realize that same connection needs to be replicated in VS13 for TFPT2013 to work. It connects to same server and workspace.
I also tried doing it using TFPT2015 but I installed it and it didn't install TFPT.exe hence it was useless. So I tried from TFPT2013 to TFS2015 and it worked for this particular command. I wonder, why not, if VS12/13 works fine against TFS2015?
To summarize
Use CMD or DevCMD - doesn't matter
run from source branch root folder
verify Team Explorer Server connection
TF Power Tools 2013 work against TFS v15, at least migrate option works
My first answer explains how to have this done properly using TFPT. In this answer, I want to explain how to do it without TFPT.
Every developer should have multiple workspaces. Because we work on multiple issues simultaneously and we don't want to mix it up. so, you work on one issue in WS1 and another issue in WS2. So, if you unshelve your shelveset in a different workspace, this will do that as well. Because your shelveset can't point to 2 different locations in the same workspace. But in different workspace it will unshelve to a location mapped in that workspace.
I ran into the same problem as Boris Callens. I had installed the TF Power Tools for VS2012 and VS2013. When runing the tfpt.exe command in command promt I always had the error message "unable to determine the workspace". This is because I was using the VS 2012 power tools with TFS 2013. So I had to change the Path to the Power Tools in the System Environment Variable "TFSPowerToolDir" to point to the Power Tools for VS2013.
You can find the version number running: tfpt.exe /?
TF Power Tools version

Resources