ClickOnce アプリケーション マニフェスト

アプリケーション マニフェストとは、ClickOnce を使用して配置されるアプリケーションを記述する XML ファイルです。

アプリケーション マニフェストには次の要素と属性があります。

要素

説明

属性

<assembly> 要素 (ClickOnce アプリケーション)

必ず指定します。 最上位の要素です。

manifestVersion

<assemblyIdentity> 要素 (ClickOnce アプリケーション)

必ず指定します。 ClickOnce アプリケーションのプライマリ アセンブリを指定します。

name

version

publicKeyToken

processorArchitecture

language

<trustInfo> 要素 (ClickOnce アプリケーション)

アプリケーションのセキュリティ要件を指定します。

なし

<entryPoint> 要素 (ClickOnce アプリケーション)

必ず指定します。 アプリケーション コードのエントリ ポイントを指定します。

name

<dependency> 要素 (ClickOnce アプリケーション)

必ず指定します。 アプリケーションを実行するために必要な依存関係をそれぞれ指定します。 必要な場合には、プレインストールしなければならないアセンブリを指定します。

なし

<file> 要素 (ClickOnce アプリケーション)

省略できます。 アプリケーションで使用する、アセンブリ以外のファイルを指定します。 ファイルに関連付けられている分離COM (Component Object Model) コンポーネントを含めることができます。

name

size

group

optional

writeableType

<fileAssociation> 要素 (ClickOnce アプリケーション)

省略できます。 アプリケーションに関連付ける拡張子を指定します。

extension

description

progid

defaultIcon

解説

アプリケーション マニフェスト ファイルは、ClickOnce を使用して配置されるアプリケーションを指定するものです。 ClickOnce の詳細については、「ClickOnce のセキュリティと配置」を参照してください。

ファイルの場所

1 つのアプリケーション マニフェストは、配置の 1 つのバージョンに対応します。 このため、アプリケーション マニフェストは、配置マニフェストとは別の場所に格納する必要があります。 通常は、関連付けられたバージョンに合わせた名前を付けたサブディレクトリに格納します。

アプリケーション マニフェストには、配置する前に署名する必要があります。 アプリケーション マニフェストを手動で変更した場合は、mage.exe を使用して、アプリケーション マニフェストに再署名し、配置マニフェストを更新してから、配置マニフェストに再署名する必要があります。 詳細については、「チュートリアル : ClickOnce アプリケーションを手動で配置する」を参照してください。

ファイル名の構文

アプリケーション マニフェスト ファイルの名前は、assemblyIdentity 要素に指定されたアプリケーションの完全な名前および拡張子に、.manifest という拡張子を付けた名前にします。 たとえば、Example.exe アプリケーションを参照するアプリケーション マニフェストでは、次のファイル名を使用します。

example.exe.manifest

使用例

次のコード例は、ClickOnce アプリケーションのアプリケーション マニフェストを示しています。

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1">
  <asmv1:assemblyIdentity name="My Application Deployment.exe" version="1.0.0.0" publicKeyToken="43cb1e8e7a352766" language="neutral" processorArchitecture="x86" type="win32" />
  <application />
  <entryPoint>
    <assemblyIdentity name="MyApplication" version="1.0.0.0" language="neutral" processorArchitecture="x86" />
    <commandLine file="MyApplication.exe" parameters="" />
  </entryPoint>
  <trustInfo>
    <security>
      <applicationRequestMinimum>
        <PermissionSet Unrestricted="true" ID="Custom" SameSite="site" />
        <defaultAssemblyRequest permissionSetReference="Custom" />
      </applicationRequestMinimum>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <!--
          UAC Manifest Options
          If you want to change the Windows User Account Control level replace the 
          requestedExecutionLevel node with one of the following.

        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />

         If you want to utilize File and Registry Virtualization for backward 
         compatibility then delete the requestedExecutionLevel node.
    -->
        <requestedExecutionLevel level="asInvoker" uiAccess="false" />
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>
    <dependentOS>
      <osVersionInfo>
        <os majorVersion="4" minorVersion="10" buildNumber="0" servicePackMajor="0" />
      </osVersionInfo>
    </dependentOS>
  </dependency>
  <dependency>
    <dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
      <assemblyIdentity name="Microsoft.Windows.CommonLanguageRuntime" version="4.0.20506.0" />
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MyApplication.exe" size="4096">
      <assemblyIdentity name="MyApplication" version="1.0.0.0" language="neutral" processorArchitecture="x86" />
      <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>DpTW7RzS9IeT/RBSLj54vfTEzNg=</dsig:DigestValue>
      </hash>
    </dependentAssembly>
  </dependency>
<publisherIdentity name="CN=DOMAINCONTROLLER\UserMe" issuerKeyHash="18312a18a21b215ecf4cdb20f5a0e0b0dd263c08" /><Signature Id="StrongNameSignature" xmlns="http://www.w3.org/2000/09/xmldsig#">
…
</Signature></r:issuer></r:license></msrel:RelData></KeyInfo></Signature></asmv1:assembly>

参照

その他の技術情報

ClickOnce アプリケーションの発行