GenerateApplicationManifest Task

Generates a ClickOnce application manifest or a native manifest. A native manifest describes a component by defining a unique identity for the component and identifying all assemblies and files that make up the component. A ClickOnce application manifest extends a native manifest by indicating the entry point of the application, and specifying the application security level.

The following table describes the parameters for the GenerateApplicationManifest task.

Parameter

Description

AssemblyName

Optional String parameter.

Specifies the Name field of the assembly identity for the generated manifest. If this parameter is not specified, the name is inferred from the EntryPoint or InputManifest parameters. If no name can be created, the task throws an error.

AssemblyVersion

Optional String parameter.

Specifies the Version field of the assembly identity for the generated manifest. If this parameter is not specified, a default value of "1.0.0.0" is used.

ClrVersion

Optional String parameter.

Specifies the minimum version of the Common Language Runtime (CLR) required by the application. The default value is the CLR version in use by the build system. If the task is generating a native manifest, this parameter is ignored.

Specifies an item list that defines the set of dependent assemblies for the generated manifest. Each item may be further described by item metadata to indicate additional deployment state and the type of dependence. For more information, see the "Item Metadata" section below.

Indicates the application icon file. The application icon is expressed in the generated application manifest and is used for the Start Menu and Add/Remove Programs dialog. If this input is not specified, a default icon is used. If the task is generating a native manifest, this parameter is ignored.

Indicates an input XML document to serve as a base for the manifest generator. This allows structured data such as application security or custom manifest definitions to be reflected in the output manifest. The root element in the XML document must be an assembly node in the asmv1 namespace.

Specifies COM components to isolate in the generated manifest. This parameter supports the ability to isolate COM components for "Registration Free COM" deployment. It works by auto-generating a manifest with standard COM registration definitions. However, the COM components must be registered on the build machine in order for this to function properly.

ManifestType

Optional String parameter.

Specifies which type of manifest to generate. This parameter can have the following values:

Native

ClickOnce

If this parameter is not specified, the task defaults to ClickOnce.

MaxTargetPath

Optional String parameter.

Specifies the maximum allowable length of a file path in a ClickOnce application deployment. If this value is specified, the length of each file path in the application is checked against this limit. Any items that exceed the limit will raise in a build warning. If this input is not specified or is zero, then no checking is performed. If the task is generating a native manifest, this parameter is ignored.

OSVersion

Optional String parameter.

Specifies the minimum required operating system (OS) version required by the application. For example, the value "5.1.2600.0" indicates the operating system is Windows XP. If this parameter is not specified, the value "4.10.0.0" is used, which indicates Windows 98 Second Edition, the minimum supported OS of the .NET Framework. If the task is generating a native manifest, this input is ignored.

Specifies the name of the generated output manifest file. If this parameter is not specified, the name of the output file is inferred from the identity of the generated manifest.

Platform

Optional String parameter.

Specifies the target platform of the application. This parameter can have the following values:

AnyCPU

x86

x64

Itanium

If this parameter is not specified, the task defaults to AnyCPU.

Product

Optional String parameter.

Specifies the name of the application. If this parameter is not specified, the name is inferred from the identity of the generated manifest. This name is used for the shortcut name on the Start menu and is part of the name that appears in the Add or Remove Programs dialog box.

Publisher

Optional String parameter.

Specifies the publisher of the application. If this parameter is not specified, the name is inferred from the registered user, or the identity of the generated manifest. This name is used for the folder name on the Start menu and is part of the name that appears in the Add or Remove Programs dialog box.

RequiresMinimumFramework35SP1

Optional Boolean parameter.

If true, the application requires the .NET Framework 3.5 SP1 or a more recent version.

TargetCulture

Optional String parameter.

Identifies the culture of the application and specifies the Language field of the assembly identity for the generated manifest. If this parameter is not specified, it is assumed the application is culture invariant.

Indicates an XML document that specifies the application security. The root element in the XML document must be a trustInfo node in the asmv2 namespace. If the task is generating a native manifest, this parameter is ignored.

UseApplicationTrust

Optional [Boolean] parameter.

If true, the Product, Publisher, and SupportUrl properties are written to the application manifest.

In addition to the parameters listed above, this task inherits parameters from the GenerateManifestBase class, which itself inherits from the Task class. For a list of the parameters of the Task class, see Task Base Class.

The inputs for dependencies and files may be further decorated with item metadata to specify additional deployment state for each item.

Item Metadata

Metadata name

Description

DependencyType

Indicates whether the dependency is published and installed with the application or a prerequisite. This metadata is valid for all dependencies, but is not used for files. The available values for this metadata are:

Install

Prerequisite

Install is the default value.

AssemblyType

Indicates whether the dependency is a managed or a native assembly. This metadata is valid for all dependencies, but is not used for files. The available values for this metadata are:

Managed

Native

Unspecified

Unspecified is the default value, which indicates that the manifest generator will determine the assembly type automatically.

Group

Indicates the group for downloading additional files on-demand. The group name is defined by the application and can be any string. An empty string indicates the file is not part of a download group, which is the default. Files not in a group are part of the initial application download. Files in a group are only downloaded when explicitly requested by the application using System.Deployment.Application.

This metadata is valid for all files where IsDataFile is false and all dependencies where DependencyType is Install.

TargetPath

Specifies how the path should be defined in the generated manifest. This attribute is valid for all files. If this attribute is not specified, the item specification is used. This attribute is valid for all files and dependencies with a DependencyType value of Install.

IsDataFile

A Boolean metadata value that indicates whether or not the file is a data file. A data file is special in that it is migrated between application updates. This metadata is only valid for files. False is the default value.

This example uses the GenerateApplicationManifest task to generate a ClickOnce application manifest and the GenerateDeploymentManifest task to generate a deployment manifest for an application with a single assembly. It then uses the SignFile task to sign the manifests.

This illustrates the simplest possible manifest generation scenario where ClickOnce manifests are generated for a single program. A default name and identity are inferred from the assembly for the manifest.

Note

In the example below, all application binaries are pre-built in order to focus on manifest generation aspects. This example produces a fully working ClickOnce deployment.

Note

For more information on the Thumbprint property used in the SignFile task in this example, see SignFile Task.

This example uses the GenerateApplicationManifest and GenerateDeploymentManifest tasks to generate ClickOnce application and deployment manifests for an application with a single assembly, specifying name and identity of manifests.

This example is similar to previous example except the name and identity of the manifests are explicitly specified. Also, this example is configured as an online application instead of an installed application.

Note

In the example below, all application binaries are pre-built in order to focus on manifest generation aspects. This example produces a fully working ClickOnce deployment.

Note

For more information on the Thumbprint property used in the SignFile task in this example, see SignFile Task.