Click to Rate and Give Feedback

  Switch on low bandwidth view
Application Manifests

An application manifest is an XML file that describes and identifies the shared and private side-by-side assemblies that an application should bind to at run time. These should be the same assembly versions that were used to test the application. Application manifests may also describe metadata for files that are private to the application.

For a complete listing of the XML schema, see Manifest File Schema.

Application manifests have the following elements and attributes.

ElementAttributesRequired
<assembly>Yes
 manifestVersionYes
<noInherit>No
<assemblyIdentity>Yes
 typeYes
 nameYes
 languageNo
 processorArchitectureNo
 versionYes
 publicKeyTokenNo
<dependency>No
<dependentAssembly>No
<file>No
 nameNo
 hashalgNo
 hashNo

 

File Location

Application manifests should be included as a resource in the application's EXE file or DLL.

For more information, see Installing Side-by-side Assemblies.

File Name Syntax

The name of an application manifest file is the name of the application's executable followed by .manifest.

For example, an application manifest that refers to Example.exe or Example.dll would use the following file name syntax. You can omit the <resource ID> field if resource ID is 1.

example.exe.<resource ID>.manifest
example.dll.<resource ID>.manifest

Elements

Names of elements and attributes are case-sensitive. The values of elements and attributes are case-insensitive, except for the value of the type attribute.

<assembly>

A container element. Its first subelement must be a <noInherit> or <assemblyIdentity> element. Required.

The <assembly> element must be in the namespace "urn:schemas-microsoft-com:asm.v1". Child elements of the assembly must also be in this namespace, by inheritance or by tagging.

The <assembly> element has the following attributes.

AttributeDescription
manifestVersionThe manifestVersion attribute must be set to 1.0.

 

<noInherit>

Include this element in an application manifest to set the activation contexts generated from the manifest with the "no inherit" flag. When this flag is not set in an activation context, and the activation context is active, it is inherited by new threads in the same process, windows, window procedures, and Asynchronous Procedure Calls. Setting this flag prevents the new object from inheriting the active context.

The <noInherit> element is optional and typically omitted. Most assemblies do not work correctly using a no-inherit activation context because the assembly must be explicitly designed to manage the propagation of their own activation context. The use of the <noInherit> element requires that any dependent assemblies referenced by the application manifest have a <noInherit> element in their assembly manifest.

If <noInherit> is used in a manifest, it must be the first subelement of the <assembly> element. The <assemblyIdentity> element should come immediately after the <noInherit> element. If <noInherit> is not used, <assemblyIdentity> must be the first subelement of the <assembly> element. The <noInherit> element has no child elements. It is not a valid element in assembly manifests.

<assemblyIdentity>

As the first subelement of an <assembly> element, <assemblyIdentity> describes and uniquely identifies the application owning this application manifest. As the first subelement of a <dependentAssembly> element, <assemblyIdentity> describes a side-by-side assembly required by the application. Note that every assembly referenced in the application manifest requires an <assemblyIdentity> that exactly matches the <assemblyIdentity> in the referenced assembly's own assembly manifest.

The <assemblyIdentity> element has the following attributes. It has no subelements.

AttributeDescription
typeSpecifies the application or assembly type. The value must be Win32 and all in lower case. Required.
nameUniquely names the application or assembly. Use the following format for the name: Organization.Division.Name. For example Microsoft.Windows.mysampleApp. Required.
languageIdentifies the language of the application or assembly. Optional. If the application or assembly is language-specific, specify the DHTML language code.

In the <assemblyIdentity> of an application intended for worldwide use (language neutral) omit the language attribute.

In an <assemblyIdentity> of an assembly intended for worldwide use (language neutral) set the value of language to "*".

processorArchitectureSpecifies the processor. The valid values are x86 for 32-bit Windows and ia64 for 64-bit Windows. Optional.
versionSpecifies the application or assembly version. Use the four-part version format: mmmmm.nnnnn.ooooo.ppppp. Each of the parts separated by periods can be 0-65535 inclusive. For more information, see Assembly Versions. Required.
publicKeyTokenA 16-character hexadecimal string representing the last 8 bytes of the SHA-1 hash of the public key under which the application or assembly is signed. The public key used to sign the catalog must be 2048 bits or greater. Required for all shared side-by-side assemblies.

 

<dependency>

Contains at least one <dependentAssembly>. It has no attributes. Optional.

<dependentAssembly>

The first subelement of <dependentAssembly> must be an <assemblyIdentity> element that describes a side-by-side assembly required by the application. Every <dependentAssembly> must be inside exactly one <dependency>. It has no attributes.

<file>

Specifies files that are private to the application. Optional.

The <file> element has the attributes shown in the following table.

AttributeDescription
nameName of the file. For example, Comctl32.dll.
hashalgAlgorithm used to create a hash of the file. This value should be SHA1.
hashA hash of the file referred to by name. A hexadecimal string of length depending on the hash algorithm.

 

 

Example

The following is an example of an application manifest for an application named MySampleApp.exe. The application consumes the SampleAssembly side-by-side assembly.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity type="win32" 
                    name="myOrganization.myDivision.mySampleApp" 
                    version="6.0.0.0" 
                    processorArchitecture="x86" 
                    publicKeyToken="0000000000000000"
  />
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" 
                        name="Proseware.Research.SampleAssembly" 
                        version="6.0.0.0" 
                        processorArchitecture="X86" 
                        publicKeyToken="0000000000000000" 
                        language="*"
      />
    </dependentAssembly>
  </dependency>
</assembly>

Send comments about this topic to Microsoft

Build date: 6/4/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker