Integrating Matlab with Team Foundation Server 2010

I just managed to pull this integration off, and the process definitely deserves more web presence.

First, as of 2011, Matlab (I never understood the shout-ish MATLAB spelling) consumes only MSSCCI source control connections, which a Team Explorer installation does not supply by default. To correct that, install and run the Team Foundation Server MSSCCI Provider 2010 from the VS code gallery.  Beyond the binaries it installs – which seem to act as thin adapters to the real TFS functionality – it populates some registry keys, but mainly:

1. HKLM\SOFTWARE\SourceCodeControlProvider\InstalledSCCProviders:  a string value with a path to a TFS MSSCCI facade registry key

2. HKLM\SOFTWARE\Microsoft\Team Foundation Server MSSCCI Provider: the provider facade, containing at the very least the SCCServerName and SCCServerPath strings.

Now when source control is set from within Matlab/file/preferences, you can already see the TFS option:

It seems until Matlab R2007a, there were some issues with this long name, and you had to manually shorten it. I didn’t witness any such issues so I suppose they’re long resolved.

However – the work isn’t yet done: when you try and perform any source control operation on a file (or sometimes even just edit it), you get error TF249051:

Obviously Matlab still maintains somewhere the previous connection strings (in my case, to Perforce source control). Now this took a deeper dive with Process Monitor, but the culprit was eventually found.

Matlab places the innocent looking file mw.scc, somewhere deep in your user settings folder (in my case, C:\Users\Matlab\AppData\Roaming\MathWorks\MATLAB\R2010b\).

For P4 bindings, the file contains text like:

#Mathworks source code control preferences.
#Wed Aug 10 13:57:16 IDT 2011
d./work/matlab/dailytests.SccAuxPath=P4SCC\#myP4server\:1666\#\#myP4user\#\#myP4workspace
d./work/matlab/dailytests.SccProjectName=Perforce Project

And you have to empty it manually. After you do, Matlab will fill it with valid TFS connection strings, like:

#Mathworks source code control preferences.
#Thu Nov 24 14:43:44 IST 2011
d./work/matlab/dailytests.SccAuxPath=http\://myTFSserver\:8080/tfs/defaultcollection|yadda|yadda\\yadda
d./work/matlab/dailytests.SccProjectName=$/yadda/yadda/yadda

Hope this helps someone out there.

Advertisements
This entry was posted in Matlab, Source Control. Bookmark the permalink.

4 Responses to Integrating Matlab with Team Foundation Server 2010

  1. Kika says:

    Note that using 64-bit Matlab you’d need the 64-bit version of Team Foundation Server MSSCCI Provider 2010:
    http://visualstudiogallery.msdn.microsoft.com/69371e0f-738f-417d-bf2f-7bd2d08dc40b

  2. Pablo says:

    Thanks for this very interesting post.
    Do you know if a similar connection could be possible from MATLAB running in a Linux OS to a Team Foundation Server over a network?

  3. Joe Rose says:

    Hello, Many thanks for this article, which I have successfully used to get MATLAB R2013b linked through Visual Studio 2012/Team Explorer 2012 and the MSSCCI Adaptor for TFS 2012 (note – not 2010) to MS Team Foundation Server 2010… The issues with the wm.scc file did not appear with this later combination. I’ve successfully checked files in and out, updated comments, compared versions etc. . The Source Code Explorer window within VS2012 is still a better place to actually manage the file and folder structure, but all other operations can be conducted within MATLAB itself.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s