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

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

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

要素 説明 属性
<assembly> 要素 必須。 最上位の要素です。 manifestVersion
<assemblyIdentity> 要素 必須。 ClickOnce アプリケーションのプライマリ アセンブリを指定します。 name

version

publicKeyToken

processorArchitecture

language
<trustInfo> 要素 アプリケーションのセキュリティ要件を識別します。 なし
<entryPoint> 要素 必須。 アプリケーション コードのエントリ ポイントを識別します。 name
<dependency> 要素 必須。 アプリケーションを実行するために必要な依存関係をそれぞれ識別します。 任意で、プレインストールする必要のあるアセンブリを識別します。 なし
<file> 要素 省略可能。 アプリケーションで使用する、アセンブリ以外の各ファイルを指定します。 ファイルに関連付けられているコンポーネント オブジェクト モデル (COM) 分離データを含めることができます。 name

size

group

optional

writeableType
<fileAssociation> 要素 省略可能。 アプリケーションに関連付けられるファイル拡張子を識別します。 extension

description

progid

defaultIcon

解説

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

ファイルの場所

ClickOnce アプリケーション マニフェストは、配置の 1 つのバージョンに固有のものです。 そのため、これらは配置マニフェストとは別に保存する必要があります。 一般的な規則として、関連するバージョンに基づく名前が付けられたサブディレクトリに配置します。

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

ファイル名の構文

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>

関連項目