We get this question often enough that I thought I would post the answer. In the future, I'll be posting answers to common Team Build questions as discrete blog posts tagged with "FAQ" to facilitate browsing or subscription via RSS.
If you’re trying to build a Visual Studio Setup Project (.vdproj) I refer you to the following MSDN walkthrough:
Configuring Team Foundation Build to Build a Visual Studio Setup Project
As an alternative, please consider using WiX and Votive.