0
votes


I'm trying to get the Output folder of referenced project in my Wix Visual Studio project, using MsBuild task. But it is failing with following error:

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(724,5): error : The OutputPath property is not set for project 'ConsoleApplicatio n1.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Release' Platfo rm='x86'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Plat form that doesn't exist for this project. [C:\Users\fwaheed\Documents\Visual Studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.cspro j]

Following is the Target calling MsBuild task.

<Target Name="AfterBuild">
      <MSBuild 
          Projects="@(ProjectReference)" 
          Targets="GetTargetPath" 
          BuildInParallel="false" 
          Condition="'%(Name)'=='ConsoleApplication1'" >
        <Output TaskParameter="TargetOutputs" ItemName="DependentAssemblies" />
    </MSBuild>
  </Target>

Please note that same target worked perfectly if it is CSharp project, but failing in Wix project.

Can someone guide how to get ReferencedProjects output dirs in Wix Projects?

Thanks

1

1 Answers

1
votes

You can try to see how Wix does it for passing the reference values to candle on build. They're in the wix2010.targets or wix200x.targets file. Unfortunately I don't have the time to really dig into this stuff but the properties these tasks set should still exist to be used in your AfterBuild target.

Just search for "ResolveReferences" in one of those targets files.

You can also just try setting

<OutputPath>somepathhere</OutputPath>

in your csproj file since msbuild is complaining that the property isn't set.