File Exchange

image thumbnail

TFS Version Control Integration

version (15.8 MB) by Jasper Schneider
TFS Version Control Integration in MATLAB and Simulink.


Updated 30 May 2017

View Version History

View License

TFS Version Control Integration in MATLAB and Simulink.

Cite As

Jasper Schneider (2021). TFS Version Control Integration (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (27)


Hi Jasper,
thanks for the project. I have two issues:
*On Matlab R2019a, it keeps asking workitem IDs while commiting files, which I do not have or defined any workitem. so, I could not able to commit them.
*On Matlab R2015aSP1, it gives below error after restart: I try to delete entires contains TFS in javaclasspath.txt files as mentioned in comments but Matlab does not see TFS source control. I re-install app and it creates same paths in javaclasspath.txt.
ERROR: Error starting reference:file:/C:/Users/xxxxxx/Documents/MATLAB/Apps/TFSVersionControlIntegration/dist/integration/tfsCmlink.jar (org.osgi.framework.BundleException: Activator start error in bundle com.mathworks.cmlink [29].)

We are using TFS 2018 (Version 16.131.28106.2)

Richard Mustakos

Hi Jasper,
I appreciate the effort you have put into this.
I am using Matlab R2019a and TFS 2012 and wonder, is there a way to see what is going on with comms?
I connect to my TFS server and select the same path shown in Source Control Explorer of Visual Studio 2017 (eg: $/Area/Project), create and give it a new sandbox folder, and select retrieve. It asks if I want to continue, and I select OK.
It spins for a little while, creates a $tfs directory in the selected folder, and none of the files from that project appear in the folder.
I select Source-Control/View Details, and they look right.
I select Source-Control/Manage Files and give it a new directory and project that doesn't exist, and it does exactly the same thing, leading me to believe that there is something not right in the path being sent.
Can I ask what the last version of TFS you tested this with?
I understand there were some big changes between 2008 and 2012 that I could see breaking it.

Pascal Geschwill

Hi Jasper,

thanks for developing this tool.
I installed the app and managed to set the javaclasspaths correctly, however whenever I try to connect to the TFS repo, I get the following exception:


After googling a bit I found a blogpost ( saying that I need to set a Java system property.
Am I on the right track here or do you have any suggestions on how to proceed from here?


Andy Murray

Could be better, but it gets the job done

Matt Gortner

Jasper - Thank you for the insights.

Jasper Schneider

Without knowing more about your specific requirements, my general recommendation would be to choose between TFVC and Git first based on whether a centralized or distributed source control system makes more sense for your team's workflows, and then to focus on things like integration with other tools second.
This page is a little VSTS specific, but it recommends you choose Git unless you have a specific need for the centralized server approach used by TFVC:

If MATLAB integration is a hard requirement for you and a deciding factor in which source control technology to use, this might sound a little odd as the author of this add-on, but you might want to consider switching to Git. Don't get me wrong, if your team has a need for TFVC, then I definitely recommend you test out this add-on to see if it can add value for you, but if you really do have a choice in the matter, I would personally lean towards Git for the following reasons:
Git integration is built directly into MATLAB, so you don't need to install an add-on. As part of the official product, support will be more formal. Also, as updates are made to MATLAB's source control integration platform, the built-in Git integration will get these updates sooner. There are also lots more tools that integrate with Git, which would give your team members more freedom to use whatever tools/workflows fit best for them. I've also personally found it much easier to switch between Git branches than to juggle between TFVC shelfsets when working on more than one thing at a time.

Matt Gortner

Thanks for replying. We are on TFS2010 and won't be updating for a few more months.

In your opinion is TFS support within Matlab using the add-on sustainable in the long-term? Will we have to switch to Git eventually?


Jasper Schneider

Hi Matt,

TFS has two kinds of workspaces: "local workspaces" and "server workspaces". The TFS integration with MATLAB uses local workspaces to streamline some user experiences. For example, with a local workspace, editing a file automatically sets the TFS file state to "edit". With a server workspace, you need to explicitly call a "tf edit" command to tell the server about changes you've made.

Local workspaces were introduced in TFS 2012. Are you using an older version of TFS? Is it possible to upgrade your TFS instance?


Matt Gortner

I'm getting the following error and have been unable to resolve it. Any idea?

TF204000: The Team Foundation server to which your team project is connected does not support local workspaces.


It would be great if there was a short video showing how to do the basic functions of TFS for a Matlab code project. And include some basic background.

Tim Hosey

Hi Rob,

It looks like your user java class path file has some incorrect entries in it. The script installTFS should not create entries that start with the $ token.

Could you take a look at the file
>> file = fullfile(prefdir,'javaclasspath.txt')
and delete it or remove any entries that contain TFS. If you then restart MATLAB the warnings should go away.

It should be possible to rerun the installTFS script after doing this. If this doesn't work feel free to contact me directly and I'll work with you to get this integration working.


Rob Edge


I am having some trouble when restarting MATLAB after step 2.

I get:

""Warning: Unrecognized token "$\MATLAB\Add-Ons\Apps\TFSVersionControlIntegration\code\dist\TFS-SDK\redist\lib\....jar" in Java path specification."
""Warning: Unrecognized token "$\MATLAB\Add-Ons\Apps\TFSVersionControlIntegration\code\dist\intergation\....jar" in Java path specification"

With the .jar file in each folder apparently causing the problem.

Any ideas how to fix this?



John Harris

Had some trouble with a java error while sorting simulink project files by the column that shows commit numbers. Looks like if the column contains blanks (files that are not yet checked in), it throws an error and you get to start matlab.

I decided to remove it because I ended up using DevStudio anyway.
Botched the install, had to reinstall and then follow the uinstall directions and delete the add-on folder manually to get the TFS Endpoint box to go away.

John Harris

note: was able to fully uninstall by removing the remaining files under my Add-On install directory

Tim Hosey

Hi Pasquale,
This integration requires the URL of your TFS server (endpoint) to work properly. An example URL is given in the documentation for this app.
Please feel free to contact me if you need some help getting started using this integration.

Pasquale Vazzana

doesn't work for me, keeps asking the TFS endpoint

Melker Härefors

I am trying to use TFS in VS2015/MATLAB 2017a.
In TFS we can set labels on a set of model files and select to check out from label.
I have not found how to check out from label in Matlab or SimulinkProject. Is it possible? Or is it only possible to check out the most recent version?
The inface also creates TFS workspace with names as 'MathworksSandbox1511251980172'. Is it possible to define more specific names, related to the model names and versions?

John Mark Ellis

Works as described

John Mark Ellis

James Chaldecott

Regarding the problem with TFS workspaces created with VS2015 and later. If you would like that fixed then please vote for the UserVoice idea here:


Thanks for the tips - I've reverted to the MS Explorer integration, which whilst clunky means I don't have to delete workspaces (sounds dangerous to me ...).

John Harris

When you restart Matlab and get to "Usage Instructions" step 1,
- For the repository path, enter the source location on the TFS Server (ex: $/MyProject/Src/Main)

One of the known issues noted in the install instructions is:
"The TFS Java SDK uses an older version of the TFS APIs than Visual Studio. Workspaces you create with the Java SDK are usable in Visual Studio, but Workspaces created in Visual Studio have inconsistent behavior with the SDK."

So basically if you have a workspace that was created in Dev Studio for "$/MyProject/Src/Main" you need to go delete that workspace, then go to Matlab and create the workspace there.
I believe you have to delete this workspace even if you're trying to create a workspace to a subdirectory of an existing TFS workspace (for instance, you have a Dev-Studio - generated workspace for "$/MyProject/Src/Main" and you are trying to make a new workspace via this plugin to "$/MyProject/Src/Main/Mathworks")

Gavin Walker

After running installTFS and restarting MATLAB, go to the MATLAB Current Folder tool. Right-click in blank space and select "Source Control", "Manage Files...". The "Manage Files Using Source Control" dialog appears. From the drop-down list of available Source Control Integrations, select "Team Foundation Server".

Does this help?


I got this in high hopes after being pointed to it when finding the old MS integration will cease to be supported in the future.

However, no amount of fiddling will make it work in 2016a.

The documentation is poorly written and obscure. It's not obvious for example if you have to install the app and then run the install code or not.

Even then, under "usage instructions" it states "open matlab and create a TFS workspace" - How? Where? ... "In MATLAB's explorer menu" - what is this?

It seems to me the only redeeming feature is that it's free!

Al in St. Louis

Extremely poor instructions that make references to things in the GUI by the wrong name. All it has allowed me to do so far is start multiple copies of Visual Studio from inside the MATLAB GUI. Appears to be completely useless and nonfunctional. The "Contact us" link at the bottom of this page generates and undeliverable e-mail message that bounces from Great job, guys!

Even the uninstall instructions failed. :(

John Harris

Install went well, and, glad to see this by the way!
Only 4 stars due to being released with known issues....but hey that's better than not having it!

As the appReadMe indicates, I did have to delete my Dev_Studio-created workspace in order to let MATLAB create the workspace, and after that was done I could use the workspace in Dev_Studio but it was named something awesome like MathworksSandbox1475017577339 which means nothing to the human reader.

Fair warning: don't attempt to rename that workspace via DevStudio.

Paul Barnard

Great to see this integration!

MATLAB Release Compatibility
Created with R2017a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!