I encountered an issue where a local build would fail on my machine, while succeeding on the other. I used Visual Studio 2010 for the build. This is the error message:
Error SB4062: The “Microsoft.TeamFoundation.Build.Tasks.BuildStep” task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Build.Tasks.dll.
The solution was to replace my local file from C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets with the one from a different machine with a working build. Not quite sure why I had an older targets file. Possibly, at some point I installed an older version of Visual Studio and it updated the .targets file with the older version.