Skip to main content
Version: v3

HarvestProjects Target

The HarvestProjects target passes HarvestProject items to the HeatProject task to generate authoring from a project file.

Harvesting projects is disabled by default because it may not always work correctly, but you can enable it by adding the following to the top of your WiX project file:

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

If enabled, this target is processed before compilation. Generated authoring is automatically added to the Compile item group to be compiled by the Candle task.

<ItemGroup>
<HeatProject Include="..\TestProject\TestProject.csproj">
<ProjectOutputGroups>Binaries;Sources</ProjectOutputGroups>
</HeatProject>
</ItemGroup>

The following tables describe the common WiX MSBuild properties and items that are applicable to the HarvestProjects target.

Items

The following items and item metadata are used by the HarvestProjects target.

Item or MetadataDescription
@(HarvestProject)Required item group.

The list of projects to harvest. The HeatProject item group is provided only for backward compatibility.
%(HarvestProject.ProjectOutputGroups)Optional string metadata.

The project output groups to harvest. Separate multiple output groups with semicolons. Examples include "Binaries" and "Source".
%(HarvestProject.Transforms)Optional string metadata.

XSL transforms to apply to the generated WiX authoring. Separate multiple transforms with semicolons.

Properties

The following properties are used by the HarvestProjects target.

PropertyDescription
$(HarvestProjectsAutogenerateGuids)Optional boolean property.

Whether to generate authoring that relies on auto-generation of component GUIDs. The default is $(HarvestAutogenerateGuids) if specified; otherwise, true.
$(HarvestProjectsGenerateGuidsNow)Optional boolean property.

Whether to generate authoring that generates durable GUIDs when harvesting. The default is $(HarvestGenerateGuidsNow) if specified; otherwise, false.
$(HarvestProjectsNoLogo)Optional boolean property.

Whether to show the logo for heat.exe. The default is $(NoLogo) if specified; otherwise,false.
$(HarvestProjectsProjectOutputGroups)Optional string property.

The project output groups to harvest from all projects. Separate multiple project output groups with semicolons.

This global property is only usable with MSBuild 4.0 or Visual Studio 2010, and newer.
$(HarvestProjectsSuppressAllWarnings)Optional boolean parameter.

Specifies that all warnings should be suppressed. The default is $(HarvestSuppressAllWarnings) if specified; otherwise, false.
$(HarvestProjectsSuppressFragments)Optional boolean property.

Whether to suppress generation of separate fragments when harvesting. The default is $(HarvestSuppressFragments) if specified; otherwise, true.
$(HarvestProjectsSuppressSpecificWarnings)Optional string parameter.

Specifies that certain warnings should be suppressed. The default is $(HarvestSuppressSpecificWarnings) if specified.
$(HarvestProjectsSuppressUniqueIds)Optional boolean property.

Whether to suppress generation of unique component IDs. The default is $(HarvestSuppressUniqueIds) if specified; otherwise, false.
$(HarvestProjectsTransforms)Optional string property.

XSL transforms to apply to all generated WiX authoring. Separate multiple transforms with semicolons. The default is $(HarvestTransforms) if specified.

This global property is only usable with MSBuild 4.0 or Visual Studio 2010, and newer.
$(HarvestProjectsTreatSpecificWarningsAsErrors)Optional string parameter.

Specifies that certain warnings should be treated as errors. The default is $(HarvestTreatSpecificWarningsAsErrors) if specified.
$(HarvestProjectsTreatWarningsAsErrors)Optional boolean parameter.

Specifies that all warnings should be treated as errors. The default is $(HarvestTreatWarningsAsErrors) if specified; otherwise, false/.
$(HarvestProjectsVerboseOutput)Optional boolean parameter.

Specifies that the tool should provide verbose output. The default is $(HarvestVerboseOutput) if specified.