To reply to my own post:

I did some digging in the Wix2010.targets file and found the below
target, ResolveProjectReferences.  It looks like the second <MSBuild/>
command should be invoked to actually build the project (based on the
comments).  However when the build runs via MSBuild,
BuildProjectReferences is blank at this point (despite being true pretty
much everywhere else in the build), which causes the second <MSBuild/>
to get skipped.  I haven't tried it yet, but I bet if I force that task
to run everything will work.

So it looks like BuildProjectReferences is not getting passed through
all the layers of recursive MSBuild calls somewhere.

--
Mark

  <Target
    Name="ResolveProjectReferences"
 
DependsOnTargets="AssignProjectConfiguration;_SplitProjectReferencesByFi
leExistence"
    Condition=" '@(_ProjectReferenceWithConfiguration)' != '' ">

    <!--
    When building this project from the IDE or when building a .sln from
the command line, just
    gather the referenced build outputs. The code that builds the .sln
will already have built
    the project, so there's no need to do it again here.
    
    The ContinueOnError setting is here so that, during project load, as
much information as
    possible will be passed to the compilers.
    -->
    <MSBuild
      Projects="@(_MSBuildProjectReferenceExistent)"
 
Targets="%(_MSBuildProjectReferenceExistent.Targets);GetTargetPath"
      Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration);
%(_MSBuildProjectReferenceExistent.SetPlatform)"
      Condition="'@(_ProjectReferenceWithConfiguration)'!='' and
('$(BuildingInsideVisualStudio)' == 'true' or
'$(BuildProjectReferences)' != 'true') and
'@(_MSBuildProjectReferenceExistent)' != ''"
      ContinueOnError="!$(BuildingProject)">

      <Output TaskParameter="TargetOutputs"
ItemName="_ResolvedProjectReferencePaths" />
      <Output TaskParameter="TargetOutputs"
ItemName="_MSBuildResolvedProjectReferencePaths" />
    </MSBuild>

    <!--
    Build referenced projects when building from the command line.
    
    The $(ProjectReferenceBuildTargets) will normally be blank so that
the project's default target
    is used during a P2P reference. However if a custom build process
requires that the referenced
    project has a different target to build it can be specified.
    -->
    <MSBuild
      Projects="@(_MSBuildProjectReferenceExistent)"
      Targets="$(ProjectReferenceBuildTargets)"
      Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration);
%(_MSBuildProjectReferenceExistent.SetPlatform)"
      Condition="'@(_ProjectReferenceWithConfiguration)'!='' and
'$(BuildingInsideVisualStudio)' != 'true' and
'$(BuildProjectReferences)' == 'true' and
'@(_MSBuildProjectReferenceExistent)' != ''">

      <Output TaskParameter="TargetOutputs"
ItemName="_ResolvedProjectReferencePaths" />
      <Output TaskParameter="TargetOutputs"
ItemName="_MSBuildResolvedProjectReferencePaths" />
    </MSBuild>

    <!-- Issue a warning for each non-existent project. -->
    <Warning
      Text="The referenced project
'%(_MSBuildProjectReferenceNonexistent.Identity)' does not exist."
      Condition=" '@(_ProjectReferenceWithConfiguration)' != '' and
'@(_MSBuildProjectReferenceNonexistent)'!=''"/>

    <!-- Create list of all .wixlib project references-->
    <CreateItem
      Include="@(_ResolvedProjectReferencePaths)"
      Condition=" '%(Extension)' == '.wixlib' ">

      <Output TaskParameter="Include" ItemName="WixLibProjects" />
    </CreateItem>

  </Target>

-----Original Message-----
From: Sironi, Mark 
Sent: Wednesday, April 14, 2010 4:15 PM
To: 'wix-users@lists.sourceforge.net'
Subject: Problem with build order under MSBuild 4.0

I'm having problems with project build order trying to build solutions
with Wix projects using the .Net 4.0 MSBuild.

I have a solution with an exe project and a Wix setup project to install
the exe.  The Wix project contains a reference to the setup project.
When I build the solution in VS2010 it works fine.  When I build it
using MSBuild it tries to build the Wix project before it tries to build
the exe.  If I edit the solution and force a reference at the solution
level (instead of just relying on the inferred reference in the wixproj)
MSBuild works fine.

So the problem appears to be that MSBuild is having trouble figuring out
dependencies from wixproj files; I took a quick look through the .NET
4.0 common targets & wix targets files but didn't see anything obvious.
This problem occurs in both 3.5.1419 (the version of Wix that VS2010
installed through the extensions manager) and 3.5.1602 (the most recent
build).

Can anyone offer any help?

--
Mark Sironi

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to