There's an error in the MSDN documentation on how to build Visual Studio setup projects with Team Build, which several customers have hit now (see this Team Build MSDN forum question).  The result is that the build hangs; it never returns.  The reason is that there's a line break in the MSBuild XML snippet on the MSDN documentation page that results in devenv (VS) being launched as an interactive process rather than with the set of arguments to build a deployment project.  The result is a hang, since nothing can see the instance of VS that's been launched by the build service.

The documentation page is Walkthrough: Configuring Team Build to Build a Visual Studio Setup Project.

Here's the XML that contains the error.  In step 6 of the description of the changes needed in the TfsBuild.proj file, there's a line break after "devenv"" that shouldn't be there.

</ItemGroup>
<Target Name="AfterCompile">
<Exec Command="&quot;drive letter:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv&quot;
&quot;
$(SolutionRoot)\HelloWorldTest\HelloWorldTestInstaller\HelloWorldTestInstaller.vdproj /Build &quot;Debug|Any CPU&quot;"/>
<Copy SourceFiles="$(SolutionRoot)\HelloWorldTest\HelloWorldTestInstaller\Debug\HelloWorldTestInstaller.msi"
DestinationFolder="$(OutDir)" />
<Copy SourceFiles="$(SolutionRoot)\HelloWorldTest\HelloWorldTestInstaller\Debug\setup.exe"
DestinationFolder="$(OutDir)" />
</Target>
</Project>

Here's the correct version.

</ItemGroup>
<Target Name="AfterCompile">
<Exec Command="&quot;drive letter:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv&quot;&quot;$(SolutionRoot)\HelloWorldTest\HelloWorldTestInstaller\HelloWorldTestInstaller.vdproj /Build &quot;Debug|Any CPU&quot;"/>
<Copy SourceFiles="$(SolutionRoot)\HelloWorldTest\HelloWorldTestInstaller\Debug\HelloWorldTestInstaller.msi"
DestinationFolder="$(OutDir)" />
<Copy SourceFiles="$(SolutionRoot)\HelloWorldTest\HelloWorldTestInstaller\Debug\setup.exe"
DestinationFolder="$(OutDir)" />
</Target>
</Project>

One of the customers that got bitten by this error noticed the incorrect new line and told us about it in email.  After that, we answered a similar post in the forums.  Independently, one of our testers hit the problem last week.  It's funny how these things can pop up seemingly all at once.

The documentation error should be fixed with the next MSDN documentation update.

tags: , , ,