title | ms.date | ms.topic | dev_langs | helpviewer_keywords | ms.assetid | author | ms.author | manager | ms.workload | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<fileAssociation> Element (ClickOnce Application) | Microsoft Docs |
11/04/2016 |
reference |
|
|
8f951b4f-54f9-412e-a9e5-af4e379fcf08 |
mikejo5000 |
mikejo |
jillfra |
|
Identifies a file extension to be associated with the application.
<fileAssociation
xmlns="urn:schemas-microsoft-com:clickonce.v1"
extension
description
progid
defaultIcon
/>
The fileAssociation
element is optional. The element has the following attributes.
Attribute | Description |
---|---|
extension |
Required. The file extension to be associated with the application. |
description |
Required. A description of the file type for use by the shell. |
progid |
Required. A name uniquely identifying the file type. |
defaultIcon |
Required. Specifies the icon to use for files with this extension. The icon file must be specified by using the <file> Element within the <assembly> Element that contains this element. |
This element must include an XML namespace reference to "urn:schemas-microsoft-com:clickonce.v1". If the <fileAssociation>
element is used, it must come after the <application>
element in its parent <assembly> Element.
[!INCLUDEndptecclick] will not overwrite existing file associations. However, a ClickOnce application can override the file extension for the current user only. After that ClickOnce application is uninstalled, ClickOnce deletes the file association for the user, and the per-machine association is active again.
The following code example illustrates fileAssociation
elements in an application manifest for a text editor application deployed using [!INCLUDEndptecclick]. This code example also includes the <file> Element required by the defaultIcon
attribute.
<file name="text.ico" size="4286">
<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>0joAqhmfeBb93ZneZv/oTMP2brY=</dsig:DigestValue>
</hash>
</file>
<file name="writing.ico" size="9662">
<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>2cL2U7cm13nG40v9MQdxYKazIwI=</dsig:DigestValue>
</hash>
</file>
<fileAssociation xmlns="urn:schemas-microsoft-com:clickonce.v1" extension=".text" description="Text Document (ClickOnce)" progid="Text.Document" defaultIcon="text.ico" />
<fileAssociation xmlns="urn:schemas-microsoft-com:clickonce.v1" extension=".writing" description="Writings (ClickOnce)" progid="Writing.Document" defaultIcon="writing.ico" />