Build a Reporting Services Solution with MSBuild 4.0

I recently was tasked with setting up a build for a large solution of Reporting Services reports. The goal was to build and deploy them. The build was pretty easy although disappointing. Reporting Solution projects are not msbuild projects. You can however build the solution from the command line using devenv.exe. Which looks something like this:

devenv.exe /Build debug /out ".\Logs\SSRS.Log" ReportingServices.sln

So automating this on a build server was pretty simple. Install a copy of Visual Studio 2008 or 2005 depending on the version of your reports. (No 2010 can’t even open a reporting solution let along build it.)

In source control in the same folder as your Reporting Services Solution create a batch file with the above command. I would pass the drop location in to batch file and put the log there instead of in the source directories. So the batch file may look more like this.

mkdir %1\Logs
devenv.exe /Build debug /out "%1\Logs\SSRS.Log" reportingServices.sln

Now in your build process template drag in an invoke process activity, and populate 

ExitCode is a Variable of the type int32 that you would create in your build process.

BuildDetail.DropLocation and SourcesDirectory are variables already set up for you that hold the Drop Location you selected in your Build Definition and the Sources Directory defined by your Build Agent Working Directory.