GenerateApplicationManifest Task

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest documentation on Visual Studio 2017, see GenerateApplicationManifest Task on docs.microsoft.com. 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.

ParameterDescription
AssemblyNameOptional 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.
AssemblyVersionOptional 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.
ClrVersionOptional 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.
ConfigFileOptional ITaskItem[] parameter.

Specifies which item contains the application configuration file. If the task is generating a native manifest, this parameter is ignored.
DependenciesOptional ITaskItem[] parameter.

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.
DescriptionOptional String parameter.

Specifies the description for the application or component.
EntryPointOptional ITaskItem[] parameter.

Specifies a single item that indicates the entry point for the generated manifest assembly.

For a ClickOnce application manifest, this parameter specifies the assembly that starts when the application is run.
ErrorReportUrlOptional String parameter.

Specifies the URL of the Web page that is displayed in dialog boxes during error reports in ClickOnce installations.
FileAssociationsOptional ITaskItem[] parameter.

Specifies a list of one or more file type that are associated with the ClickOnce deployment manifest.

File associations only valid only when .NET Framework 3.5 or later is targeted.
FilesOptional ITaskItem[] parameter.

The files to include in the manifest. Specify the full path for each file.
HostInBrowserOptional Boolean parameter.

If true, the application is hosted in a browser (as are WPF Web Browser Applications).
IconFileOptional ITaskItem[] parameter.

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.
InputManifestOptional ITaskItem parameter.

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.
IsolatedComReferencesOptional ITaskItem[] parameter.

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.
ManifestTypeOptional 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.
MaxTargetPathOptional 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.
OSVersionOptional 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.
OutputManifestOptional ITaskItem output parameter.

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.
PlatformOptional 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.
ProductOptional 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.
PublisherOptional 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.
RequiresMinimumFramework35SP1Optional Boolean parameter.

If true, the application requires the .NET Framework 3.5 SP1 or a more recent version.
TargetCultureOptional 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.
TargetFrameworkMonikerOptional String parameter.

Specifies the target framework moniker.
TargetFrameworkProfileOptional String parameter.

Specifies the target framework profile.
TargetFrameworkSubsetOptional String parameter.

Specifies the name of the .NET Framework subset to target.
TargetFrameworkVersionOptional String parameter.

Specifies the target .NET Framework of the project.
TrustInfoFileOptional ITaskItem parameter.

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.
UseApplicationTrustOptional 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.

For information about how to use the GenerateDeploymentManifest task, see GenerateApplicationManifest Task.

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

Metadata nameDescription
DependencyTypeIndicates 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.
AssemblyTypeIndicates 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.
GroupIndicates 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.
TargetPathSpecifies 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.
IsDataFileA 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.

System_CAPS_ICON_note.jpg 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.

System_CAPS_ICON_note.jpg Note

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

<Project DefaultTargets="Build"  
    xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  
  
    <ItemGroup>  
        <EntryPoint Include="SimpleWinApp.exe" />  
    </ItemGroup>  
  
    <PropertyGroup>  
        <Thumbprint>  
             <!-- Insert generated thumbprint here -->  
        </Thumbprint>  
    </PropertyGroup>  
  
    <Target Name="Build">  
  
        <GenerateApplicationManifest  
            EntryPoint="@(EntryPoint)">  
            <Output  
                ItemName="ApplicationManifest"  
                TaskParameter="OutputManifest"/>  
        </GenerateApplicationManifest>  
  
        <GenerateDeploymentManifest  
            EntryPoint="@(ApplicationManifest)">  
            <Output  
                ItemName="DeployManifest"  
                TaskParameter="OutputManifest"/>  
        </GenerateDeploymentManifest>  
  
        <SignFile  
            CertificateThumbprint="$(Thumbprint)"  
            SigningTarget="@(ApplicationManifest)"/>  
  
        <SignFile  
            CertificateThumbprint="$(Thumbprint)"  
            SigningTarget="@(DeployManifest)"/>  
  
    </Target>  
</Project>  

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.

System_CAPS_ICON_note.jpg 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.

System_CAPS_ICON_note.jpg Note

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

<Project DefaultTargets="Build"  
    xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  
  
    <ItemGroup>  
        <EntryPoint Include="SimpleWinApp.exe" />  
    </ItemGroup>  
  
    <PropertyGroup>  
        <Thumbprint>  
             <!-- Insert generated thumbprint here -->  
        </Thumbprint>  
    </PropertyGroup>  
  
    <Target Name="Build">  
  
        <GenerateApplicationManifest  
            AssemblyName="SimpleWinApp.exe"  
            AssemblyVersion="1.0.0.0"  
            EntryPoint="@(EntryPoint)"  
            OutputManifest="SimpleWinApp.exe.manifest">  
            <Output  
                ItemName="ApplicationManifest"  
                TaskParameter="OutputManifest"/>  
        </GenerateApplicationManifest>  
  
        <GenerateDeploymentManifest  
                AssemblyName="SimpleWinApp.application"  
                AssemblyVersion="1.0.0.0"  
                EntryPoint="@(ApplicationManifest)"  
                Install="false"  
                OutputManifest="SimpleWinApp.application">  
                <Output  
                    ItemName="DeployManifest"  
                    TaskParameter="OutputManifest"/>  
        </GenerateDeploymentManifest>  
  
        <SignFile  
            CertificateThumbprint="$(Thumbprint)"  
            SigningTarget="@(ApplicationManifest)"/>  
  
        <SignFile  
            CertificateThumbprint="$(Thumbprint)"  
            SigningTarget="@(DeployManifest)"/>  
  
    </Target>  
</Project>  

This example uses the GenerateApplicationManifest and GenerateDeploymentManifest tasks to generate ClickOnce application and deployment manifests for an application with multiple files and assemblies.

System_CAPS_ICON_note.jpg 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.

System_CAPS_ICON_note.jpg Note

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

<Project DefaultTargets="Build"  
    xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  
  
    <ItemGroup>  
        <EntryPoint Include="SimpleWinApp.exe" />  
    </ItemGroup>  
  
    <PropertyGroup>  
        <Thumbprint>  
             <!-- Insert generated thumbprint here -->  
        </Thumbprint>  
        <DeployUrl>  
            <!-- Insert the deployment URL here -->  
        </DeployUrl>  
        <SupportUrl>  
            <!-- Insert the support URL here -->  
        </SupportUrl>  
    </PropertyGroup>  
  
    <Target Name="Build">  
  
    <ItemGroup>  
        <EntryPoint Include="SimpleWinApp.exe"/>  
        <Dependency Include="ClassLibrary1.dll">  
            <AssemblyType>Managed</AssemblyType>  
            <DependencyType>Install</DependencyType>  
        </Dependency>  
        <Dependency Include="ClassLibrary2.dll">  
            <AssemblyType>Managed</AssemblyType>  
            <DependencyType>Install</DependencyType>  
            <Group>Secondary</Group>  
        </Dependency>  
        <Dependency Include="MyAddIn1.dll">  
            <AssemblyType>Managed</AssemblyType>  
            <DependencyType>Install</DependencyType>  
            <TargetPath>Addins\MyAddIn1.dll</TargetPath>  
        </Dependency>  
        <Dependency Include="ClassLibrary3.dll">  
            <AssemblyType>Managed</AssemblyType>  
            <DependencyType>Prerequisite</DependencyType>  
        </Dependency>  
  
        <File Include="Text1.txt">  
            <TargetPath>Text\Text1.txt</TargetPath>  
            <Group>Text</Group>  
        </File>  
        <File Include="DataFile1.xml ">  
            <TargetPath>Data\DataFile1.xml</TargetPath>  
            <IsDataFile>true</IsDataFile>  
        </File>  
  
        <IconFile Include="Heart.ico"/>  
        <ConfigFile Include="app.config">  
            <TargetPath>SimpleWinApp.exe.config</TargetPath>  
        </ConfigFile>  
        <BaseManifest Include="app.manifest"/>  
    </ItemGroup>  
  
    <Target Name="Build">  
  
        <GenerateApplicationManifest  
            AssemblyName="SimpleWinApp.exe"  
            AssemblyVersion="1.0.0.0"  
            ConfigFile="@(ConfigFile)"  
            Dependencies="@(Dependency)"  
            Description="TestApp"  
            EntryPoint="@(EntryPoint)"  
            Files="@(File)"  
            IconFile="@(IconFile)"  
            InputManifest="@(BaseManifest)"  
            OutputManifest="SimpleWinApp.exe.manifest">  
            <Output  
                ItemName="ApplicationManifest"  
                TaskParameter="OutputManifest"/>  
        </GenerateApplicationManifest>  
  
        <GenerateDeploymentManifest  
            AssemblyName="SimpleWinApp.application"  
            AssemblyVersion="1.0.0.0"  
            DeploymentUrl="$(DeployToUrl)"  
            Description="TestDeploy"  
            EntryPoint="@(ApplicationManifest)"  
            Install="true"  
            OutputManifest="SimpleWinApp.application"  
            Product="SimpleWinApp"  
            Publisher="Microsoft"  
            SupportUrl="$(SupportUrl)"  
            UpdateEnabled="true"  
            UpdateInterval="3"  
            UpdateMode="Background"  
            UpdateUnit="weeks">  
            <Output  
                ItemName="DeployManifest"  
                TaskParameter="OutputManifest"/>  
        </GenerateDeploymentManifest>  
  
        <SignFile  
            CertificateThumbprint="$(Thumbprint)"  
            SigningTarget="@(ApplicationManifest)"/>  
  
        <SignFile  
            CertificateThumbprint="$(Thumbprint)"  
            SigningTarget="@(DeployManifest)"/>  
  
    </Target>  
</Project>  

This example uses the GenerateApplicationManifest task to generate a native manifest for application Test.exe, referencing native component Alpha.dll and an isolated COM component Bravo.dll.

This example produces the Test.exe.manifest, making the application XCOPY deployable taking advantage of Registration Free COM.

System_CAPS_ICON_note.jpg 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.

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  
  
    <ItemGroup>  
        <File Include="Test.exe" />  
        <Dependency Include="Alpha.dll">  
            <AssemblyType>Native</AssemblyType>  
            <DependencyType>Install</DependencyType>  
        </Dependency>  
        <ComComponent Include="Bravo.dll" />  
    </ItemGroup>  
  
    <Target Name="Build">  
        <GenerateApplicationManifest  
            AssemblyName="Test.exe"  
            AssemblyVersion="1.0.0.0"  
            Dependencies="@(Dependency)"  
            Files="@(File)"  
            IsolatedComReferences="@(ComComponent)"  
            ManifestType="Native">  
            <Output  
                ItemName="ApplicationManifest"  
                TaskParameter="OutputManifest"/>  
        </GenerateApplicationManifest>  
  
    </Target>  
</Project>  

Tasks
GenerateDeploymentManifest Task
SignFile Task
Task Reference

Show: