<file> Element (ClickOnce Application)

 

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

Identifies all nonassembly files downloaded and used by the application.

<file  
    name  
    size  
    group  
    optional  
    writeableType  
>  
    <typelib  
        tlbid  
        version  
        helpdir  
        resourceid  
        flags  
    />  
    <comClass  
        clsid  
        description  
        threadingModel  
        tlbid  
        progid  
        miscStatus  
        miscStatusIcon  
        miscStatusContent  
        miscStatusDocPrint  
        miscStatusThumbnail  
    />  
    <comInterfaceExternalProxyStub  
        iid  
        baseInterface  
        numMethods  
        name  
        tlbid  
        proxyStubClass32  
    />  
    <comInterfaceProxyStub  
        iid  
        baseInterface  
        numMethods  
        name  
        tlbid  
        proxyStubClass32  
    />  
    <windowClass  
        versioned  
    />  
</file>  

The file element is optional. The element has the following attributes.

AttributeDescription
nameRequired. Identifies the name of the file.
sizeRequired. Specifies the size, in bytes, of the file.
groupOptional, if the optional attribute is not specified or set to false; required if optional is true. The name of the group to which this file belongs. The name can be any Unicode string value chosen by the developer, and is used for downloading files on demand with the ApplicationDeployment class.
optionalOptional. Specifies whether this file must download when the application is first run, or whether the file should reside only on the server until the application requests it on demand. If false or undefined, the file is downloaded when the application is first run or installed. If true, a group must be specified for the application manifest to be valid. optional cannot be true if writeableType is specified with the value applicationData.
writeableTypeOptional. Specifies that this file is a data file. Currently the only valid value is applicationData.

The typelib element is an optional child of the file element. The element describes the type library that belongs to the COM component. The element has the following attributes.

AttributeDescription
tlbidRequired. The GUID assigned to the type library.
versionRequired. The version number of the type library.
helpdirRequired. The directory that contains the Help files for the component. May be zero-length.
resourceidOptional. The hexadecimal string representation of the locale identifier (LCID). It is one to four hexadecimal digits without a 0x prefix and without leading zeros. The LCID may have a neutral sublanguage identifier.
flagsOptional. The string representation of the type library flags for this type library. Specifically, it should be one of "RESTRICTED", "CONTROL", "HIDDEN" and "HASDISKIMAGE".

The comClass element is an optional child of the file element, but is required if the ClickOnce application contains a COM component it intends to deploy using registration-free COM. The element has the following attributes.

AttributeDescription
clsidRequired. The class ID of the COM component expressed as a GUID.
descriptionOptional. The class name.
threadingModelOptional. The threading model used by in-process COM classes. If this property is null, no threading model is used. The component is created on the main thread of the client and calls from other threads are marshaled to this thread. The following list shows the valid values:

 Apartment, Free, Both, and Neutral.
tlbidOptional. GUID for the type library for this COM component.
progidOptional. Version-dependent programmatic identifier associated with the COM component. The format of a ProgID is <vendor>.<component>.<version>.
miscStatusOptional. Duplicates in the assembly manifest the information provided by the MiscStatus registry key. If values for the miscStatusIcon, miscStatusContent, miscStatusDocprint, or miscStatusThumbnail attributes are not found, the corresponding default value listed in miscStatus is used for the missing attributes. The value can be a comma-delimited list of the attribute values from the following table. You can use this attribute if the COM class is an OCX class that requires MiscStatus registry key values.
miscStatusIconOptional. Duplicates in the assembly manifest the information provided by DVASPECT_ICON. It can provide an icon of an object. The value can be a comma-delimited list of the attribute values from the following table. You can use this attribute if the COM class is an OCX class that requires Miscstatus registry key values.
miscStatusContentOptional. Duplicates in the assembly manifest the information provided by DVASPECT_CONTENT. It can provide a compound document displayable for a screen or printer. The value can be a comma-delimited list of the attribute values from the following table. You can use this attribute if the COM class is an OCX class that requires MiscStatus registry key values.
miscStatusDocPrintOptional. Duplicates in the assembly manifest the information provided by DVASPECT_DOCPRINT. It can provide an object representation displayable on the screen as if printed to a printer. The value can be a comma-delimited list of the attribute values from the following table. You can use this attribute if the COM class is an OCX class that requires MiscStatus registry key values.
miscStatusThumbnailOptional. Duplicates in an assembly manifest the information provided by DVASPECT_THUMBNAIL. It can provide a thumbnail of an object displayable in a browsing tool. The value can be a comma-delimited list of the attribute values from the following table. You can use this attribute if the COM class is an OCX class that requires MiscStatus registry key values.

The comInterfaceExternalProxyStub element is an optional child of the file element, but may be required if the ClickOnce application contains a COM component it intends to deploy using registration-free COM. The element contains the following attributes.

AttributeDescription
iidRequired. The interface ID (IID) which is served by this proxy. The IID must have braces surrounding it.
baseInterfaceOptional. The IID of the interface from which the interface referenced by iid is derived.
numMethodsOptional. The number of methods implemented by the interface.
nameOptional. The name of the interface as it will appear in code.
tlbidOptional. The type library that contains the description of the interface specified by the iid attribute.
proxyStubClass32Optional. Maps an IID to a CLSID in 32-bit proxy DLLs.

The comInterfaceProxyStub element is an optional child of the file element, but may be required if the ClickOnce application contains a COM component it intends to deploy using registration-free COM. The element contains the following attributes.

AttributeDescription
iidRequired. The interface ID (IID) which is served by this proxy. The IID must have braces surrounding it.
baseInterfaceOptional. The IID of the interface from which the interface referenced by iid is derived.
numMethodsOptional. The number of methods implemented by the interface.
NameOptional. The name of the interface as it will appear in code.
TlbidOptional. The type library that contains the description of the interface specified by the iid attribute.
proxyStubClass32Optional. Maps an IID to a CLSID in 32-bit proxy DLLs.
threadingModelOptional. Optional. The threading model used by in-process COM classes. If this property is null, no threading model is used. The component is created on the main thread of the client and calls from other threads are marshaled to this thread. The following list shows the valid values:

 Apartment, Free, Both, and Neutral.

The windowClass element is an optional child of the file element, but may be required if the ClickOnce application contains a COM component it intends to deploy using registration-free COM. The element refers to a window class defined by the COM component that must have a version applied to it. The element contains the following attributes.

AttributeDescription
versionedOptional. Controls whether the internal window class name used in registration contains the version of the assembly that contains the window class. The value of this attribute can be yes or no. The default is yes. The value no should only be used if the same window class is defined by a side-by-side component and an equivalent non-side-by-side component and you want to treat them as the same window class. Note that the usual rules about window class registration apply—only the first component that registers the window class will be able to register it, because it does not have a version applied to it.

The hash element is an optional child of the file element. The hash element has no attributes.

ClickOnce uses an algorithmic hash of all the files in an application as a security check, to ensure that none of the files were changed after deployment. If the hash element is not included, this check will not be performed. Therefore, omitting the hash element is not recommended.

If a manifest contains a file that is not hashed, that manifest cannot be digitally signed, because users cannot verify the contents of an unhashed file.

The dsig:Transforms element is a required child of the hash element. The dsig:Transforms element has no attributes.

The dsig:Transform element is a required child of the dsig:Transforms element. The dsig:Transform element has the following attributes.

AttributeDescription
AlgorithmThe algorithm used to calculate the digest for this file. Currently the only value used by ClickOnce is urn:schemas-microsoft-com:HashTransforms.Identity.

The dsig:DigestMethod element is a required child of the hash element. The dsig:DigestMethod element has the following attributes.

AttributeDescription
AlgorithmThe algorithm used to calculate the digest for this file. Currently the only value used by ClickOnce is http://www.w3.org/2000/09/xmldsig#sha1.

The dsig:DigestValue element is a required child of the hash element. The dsig:DigestValue element has no attributes. Its text value is the computed hash for the specified file.

This element identifies all the nonassembly files that make up the application and, in particular, the hash values for file verification. This element can also include Component Object Model (COM) isolation data associated with the file. If a file changes, the application manifest file also must be updated to reflect the change.

The following code example illustrates file elements in an application manifest for an application deployed using ClickOnce.

<file name="Icon.ico" size="9216">  
  <hash>  
    <dsig:Transforms>  
      <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />  
    </dsig:Transforms>  
    <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />  
    <dsig:DigestValue>lVoj+Rh6RQ/HPNLOdayQah5McrI=</dsig:DigestValue>  
  </hash>  
</file>  

ClickOnce Application Manifest

Show: