There is code and an article for setting up Team Foundation Server for Continuous Integration that can be found at MSDN here:
Unfortunately, the article was not clearly written, with incorrect syntax for an important command.
Install the software as normal, making sure you create the virtual directory underneath the root of the application server for Team Foundation Server (this should be an IIS website called “Team Foundation Server” on port 8080. If you did something funky, put it in the funky place).
The subscription you need to create, however, does NOT follow the syntax of the article. It should be thus:
BisSubscribe.exe /eventtype CheckinEvent /address http://myMachine:8080/CI/notify.asmx /deliveryType Soap /server myMachine
where “myMachine” is the name of your server where you installed VSTS, and assuming you installed the CI software in the default virtual directory.
You also need to go into the web.config file underneath the /CI virtual directory (or where ever you installed it) and create the appsettings like this:
<add key="1" value="TeamServer=http://myMachine:8080;TeamProjectName=ProjectName;BuildType=BuildTypeName“/>
And make sure to create the entries outside of the commented code (which I did not do at first, simply changing the example setting, which is inside commented code and so useless).
The other thing is to remember to go into Visual Studio and when in Team Explorer and highlighting the Team Project you are working on to use the Team menu that appears to create and send emails on build events (I used VSTS for almost 6 months before knowing this option existed) so you know your builds are working.