Documentation error results in a build that never ends when building setup projects (.vdproj)


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 FilesMicrosoft Visual Studio 8Common7IDEdevenv&quot;
&quot;
$(SolutionRoot)HelloWorldTestHelloWorldTestInstallerHelloWorldTestInstaller.vdproj /Build &quot;Debug|Any CPU&quot;”/>
<Copy SourceFiles=”$(SolutionRoot)HelloWorldTestHelloWorldTestInstallerDebugHelloWorldTestInstaller.msi”
DestinationFolder=”$(OutDir)” />
<Copy SourceFiles=”$(SolutionRoot)HelloWorldTestHelloWorldTestInstallerDebugsetup.exe”
DestinationFolder=”$(OutDir)” />
</Target>
</Project>

Here’s the correct version.

</ItemGroup>
<Target Name=”AfterCompile”>
<Exec Command=”&quot;drive letter:Program FilesMicrosoft Visual Studio 8Common7IDEdevenv&quot;&quot;$(SolutionRoot)HelloWorldTestHelloWorldTestInstallerHelloWorldTestInstaller.vdproj /Build &quot;Debug|Any CPU&quot;”/>
<Copy SourceFiles=”$(SolutionRoot)HelloWorldTestHelloWorldTestInstallerDebugHelloWorldTestInstaller.msi”
DestinationFolder=”$(OutDir)” />
<Copy SourceFiles=”$(SolutionRoot)HelloWorldTestHelloWorldTestInstallerDebugsetup.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: , , ,

Comments (3)

  1. Pierre Médart says:

    Hi Buck,

    is it possible to use the vdproj to build a msi with MSBuild ?

    I try to apply "the Walkthrough: Configuring Team Build to Build a Visual Studio Setup Project". The output I receive from MSBuilt is

    "Solution: , Project: Trial2005.sln, Compilation errors and warnings

    c:TFSBuildTestTFSBuildTestTrial2005SourcesTrial2005Trial2005.sln(0,0): warning MSB4078: The project file "Trial2005SetupTrial2005Setup.vdproj" is not supported by MSBuild and cannot be built.

    "

    Any comment is welcome !

    Regards

    Pierre

  2. buckh says:

    MSBuild itself cannot build .vdproj projects.  However, you can invoke devenv from a build to do it.

    Step 6 in the section "Modifying the Team Foundation Build Type" of that page you referenced shows you how: http://msdn2.microsoft.com/en-us/library/ms404859(VS.80).aspx#

    Buck

  3. As one of the developers on Process MeNtOR TeamGuide, i thought for my first blog post I awould describe…