How to build projects in Team Build that only Visual Studio can build

Aaron has written a great post on using Visual Studio (devenv) from within Team Build as part of the build process.  If that sounds strange, it's necessary because there are projects that Visual Studio can build, but msbuild cannot.  Projects in this category include Visual Studio setup projects (.vdproj), SQL Reporting Services (SRS), and BizTalk.  Some projects may never be supported outside of msbuild, as is the case with the setup projects (WiX works msbuild, if you want a setup technology that doesn't rely on Visual Studio).

We have documentation, such as this walkthrough on building setup projects, showing you how to run devenv by using the Exec task in msbuild, but this approach has shortcomings.  You don't get any details in the build report.  The syntax is confusing to read with all of the quotation marks, some of which must be escaped.  But the most subtle aspect, and Aaron discovered this in the course of writing is his post, devenv rebuilds the whole solution to another directory, resulting in a different set of binaries being packaged in your setup output.

To address this, he has written a custom msbuild task that wraps devenv.  In the post he shows you how to use it, and for those who are interested, he describes how it works.  Both the compiled assembly and the source code are attached to the post.  Note that this task only works for TFS 2008 (Orcas) and not TFS 2005 (v1).

Team Build DevEnv Task

Because many Visual Studio project types are not supported in MSBuild, many Team Build users end up needing to invoke DevEnv directly.  There is a fair amount of confusion about how to do this best / simplest - I've written two posts (here and here) on the issue already! 

As such, I thought it would be helpful to write a DevEnv task that could be used to invoke DevEnv from MSBuild during the course of a Team Build build, along with some guidance on how to use it best.  I'll go through how to use the attached DLL for those who just want to use the task, go into a few chunks of the source code for those interested in how the task works, and then go through an example of how to use the task to build a setup project (*.vdproj).  A note for the lawyers: I can make no guarantees as to the awesomeness of this task or lack thereof - it is provided "as is" with no warranties and confers no rights. 


While this task isn't going to be part of Orcas (TFS 2008), we'll add it to the TFS power tools once we get some feedback.

Enjoy and let us know what you think!

tags: , , , , , , , ,

Comments (9)

  1. johnw says:

    This is a bit off the subject, but i’d love to see some guidance on building BizTalk projects.  Right now we seem to be faced with accepting binaries directly from developers (ugh!) or installing BizTalk on the Build Server (ugh!).

  2. saiprashanth says:

    i want information abt datable.rows[0].item

    above syntax present in csharp r not. if there  sent me syntax for that r alternate syntax present in csharp sent to  me.

  3. buckh says:


    I hear you.  Building BizTalk apps comes up with increasing frequency, and we’ve been having discussions lately on how to improve this in the future.

    We’re also trying to put together some guidance on it, but there’s no timetable yet.  Until BizTalk makes changes, though, the guidance will have to include installing BizTalk on the build computer to build binaries that are linked to BizTalk (hopefully, that will not be required at some point in the future, but there are discussions happening).

    Stay tuned!


  4. buckh says:


    I don’t know the answer to your question, but I’d recommend looking at the MSDN forums (


  5. Tanya says:

    It will be very heplfull if you will add it to power tools.


  6. Dave McKinstry on Part II – Build, Deploy and Database Connections. GertD on Table Structure Changes….

  7. Those of you who labored to get devenv.exe to work with TFS’s build capacity to build your setup projects

  8. Those of you who labored to get devenv.exe to work with TFS's build capacity to build your setup

  9. Ponder .NET says:

    As I work with different clients, helping them understand how Team Build and Team Edition for Database

Skip to main content