如何在HeatProject Task中引用项目参考?

时间:2014-07-02 07:16:03

标签: wix windows-installer msbuild-task wix3.7

我有这个标记。属性的值项目=" @(_项目)" HeatProject任务? Wix doc说必需的项目组参数但是我如何关联以下项目组??

  <ItemGroup>
    <ProjectReference Include="..\MyProjectA\Presentsoft.MyProjectA.csproj">
      <Name>MyProjectA</Name>
      <Project>{59FB083D-C11C-4690-A128-28F5269125D4}</Project>
      <Private>True</Private>
    </ProjectReference>
  </ItemGroup>

  <Target Name="BeforeBuild">
    <HeatProject
   NoLogo="$(HarvestProjectsNoLogo)"
   SuppressAllWarnings="$(HarvestProjectsSuppressAllWarnings)"
   SuppressSpecificWarnings="$(HarvestProjectsSuppressSpecificWarnings)"
   ToolPath="$(WixToolPath)"
   TreatWarningsAsErrors="$(HarvestProjectsTreatWarningsAsErrors)"
   TreatSpecificWarningsAsErrors="$(HarvestProjectsTreatSpecificWarningsAsErrors)"
   VerboseOutput="$(HarvestProjectsVerboseOutput)"
   AutogenerateGuids="$(HarvestProjectsAutogenerateGuids)"
   GenerateGuidsNow="$(HarvestProjectsGenerateGuidsNow)"
   OutputFile="$(IntermediateOutputPath)_%(_Project.Filename).wxs"
   SuppressFragments="$(HarvestProjectsSuppressFragments)"
   SuppressUniqueIds="$(HarvestProjectsSuppressUniqueIds)"
   Transforms="%(_Project.Transforms)"
   Project="@(_Project)"
   ProjectOutputGroups="Content;Binaries;Satellites" />
  </Target>

我是安装人员和wix的新手。

1 个答案:

答案 0 :(得分:2)

您的问题是关于MSBuild。该任务引用_Project项目组,但您有一个ProjectReference项目组。要修复它,只需在任何地方用ProjectReference替换_Project。

但是,由于设计了WiX的目标,您不需要直接调用HeatProject任务。它们作为主要构建的一部分,如果enable it一般和每个特定的项目参考。

<PropertyGroup>
  <EnableProjectHarvesting>True</EnableProjectHarvesting>
</PropertyGroup>


<ItemGroup>
  <ProjectReference Include="..\MyProjectA\Presentsoft.MyProjectA.csproj">
    <Name>MyProjectA</Name>
    <Project>{59FB083D-C11C-4690-A128-28F5269125D4}</Project>
    <Private>True</Private>
    <DoNotHarvest>
    </DoNotHarvest>
    <RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
    <RefTargetDir>INSTALLFOLDER</RefTargetDir>
  </ProjectReference>   
</ItemGroup>

输出在&#34; obj&#34;中生成。文件夹,如果你真的想看到它。但是,您需要做的就是在需要的地方添加以下内容(例如,在功能内部)。

  <ComponentGroupRef Id="MyProjectA.Binaries" />