Someone emailed me with a problem they were having on compiling SSIS projects. Or rather, it’s a case of the projects not building. This was there output:
“Rebuild All: 0 succeeded, 0 failed, 0 skipped
You see, when it comes to Visual Studio Project files, they’re essentially just a MSBuild file. And so when they’re built they’re compiled using MSBuild engine. Even those through Visual Studio.
But, not all project files are the same. Some projects cannot be compiled using MSBuild. Below is a list of project types that we can file under this category:
In order to build these, we have to execute devenv.com. This is part of the Visual Studio install and can be found somewhere around the Common7/IDE folders of your relative Visual Studio install. And there’s a multitude of ways to execute devenv in an automated build process. One approach I adopted, and is still probably the way I’d go about it now, is to create an MSBuild wrapper around executing devenv, and then as part of my build process the MSBuild target can run.
Here’s a simple demo of what I mean:
The first script is a piece of PowerShell that executes the build file below via MSBuild. You will need to change the value of the $buildFile
The second script below is an MSBuild proj file. It contains a PropertyGroup that defines the properties of where devenv is, where the SSIS solution file is and where the proj file is. You’ll need to update these to match the locations of the relative objects on your box.
Now, the crucial thing here is that the SSIS project was developed in Visual Studio 2015. However, the version of devenv I’m using is 2017. And so when I execute the PowerShell, itwill attempt to upgrade the SSIS project to Visual Studio 2017. Whether it passes or fails this task is irrespective, but this is the output from my machine:
There is an error in attempting to upgrade the version, but at any rate, it does not compile my solution.
So the solution here is to make sure you have the correct version of Visual Studio installed on your build box. What makes this particularly is the false-positive in the build succeeding, despite not actually doing anything!
Here is an updated version of the MSBuild file that would work in a build: I’ve removed the hardcoding to the files and added the $(SolutionRoot). For more info on this read this still-relevant post