Excellent walk-through for creating visual studio setup msi installers tfs build 2010:
This can still result in horrible looking errors in TFS Build when unit tests are present in the solution. One way to resolve this is to maintain a separate solution for building deployments which does not include the unit test parts (including .testsettings files). I didnt like the idea of this so continued researching and found 2 interesting points:
The following post describes how to adjust the post from above to more elegantly deal with the exceptions thrown. It doesnt deal with them as such, but will report them much better:
The following forum thread goes through a lot of the same discoveries, but ultimately concludes in a workaround – i.e. use devenv.exe instead of devenv.com
Its not a great solution, but will work for me, for now!!