ClickOnce 部署資訊清單ClickOnce deployment manifest

部署資訊清單是 XML 檔案,描述 ClickOnceClickOnce 部署,包括要部署的目前 ClickOnceClickOnce 應用程式版本之識別。A deployment manifest is an XML file that describes a ClickOnceClickOnce deployment, including the identification of the current ClickOnceClickOnce application version to deploy.

部署資訊清單具有下列項目和屬性。Deployment manifests have the following elements and attributes.

項目Element 描述Description 屬性Attributes
<assembly> 元素<assembly> Element 必要項。Required. 最上層項目。Top-level element. manifestVersion
<assemblyIdentity> 元素<assemblyIdentity> Element 必要項。Required. 識別此 ClickOnceClickOnce 應用程式的應用程式資訊清單。Identifies the application manifest for the ClickOnceClickOnce application. name

version

publicKeyToken

processorArchitecture

culture
<description> 元素<description> Element 必要項。Required. 識別應用程式資訊,這些資訊用於建立殼層的存在和 [控制台] 中的 [新增或移除程式] 項目。Identifies application information used to create a shell presence and the Add or Remove Programs item in Control Panel. publisher

product

supportUrl
<deployment> 元素<deployment> Element 選擇性。Optional. 識別用於更新部署及公開至系統的屬性。Identifies the attributes used for the deployment of updates and exposure to the system. install

minimumRequiredVersion

mapFileExtensions

disallowUrlActivation

trustUrlParameters
<compatibleFrameworks> 元素<compatibleFrameworks> Element 必要項。Required. 識別安裝及執行此應用程式所需的 .NET Framework 版本。Identifies the versions of the .NET Framework where this application can install and run. SupportUrl
<dependency> 元素<dependency> Element 必要項。Required. 識別部署所要安裝的應用程式版本,以及應用程式資訊清單的位置。Identifies the version of the application to install for the deployment and the location of the application manifest. preRequisite

visible

dependencyType

codebase

size
<publisherIdentity> 元素<publisherIdentity> Element 簽署資訊清單的必要項。Required for signed manifests. 包含簽署此部署資訊清單之發行者的資訊。Contains information about the publisher that signed this deployment manifest. Name

issuerKeyHash
<Signature> 元素<Signature> Element 選擇性。Optional. 包含對此部署資訊清單進行數位簽章時所需的資訊。Contains the necessary information to digitally sign this deployment manifest. NoneNone
<customErrorReporting> 元素<customErrorReporting> Element 選擇性。Optional. 指定要在錯誤發生時顯示的 URI。Specifies a URI to show when an error occurs. URIUri

備註Remarks

部署資訊清單檔會識別 ClickOnceClickOnce 應用程式部署,包含目前的版本與其他部署設定。The deployment manifest file identifies a ClickOnceClickOnce application deployment, including the current version and other deployment settings. 這會參考應用程式資訊清單,其中描述此應用程式的目前版本和部署內包含的所有檔案。It references the application manifest, which describes the current version of the application and all of the files contained within the deployment.

如需詳細資訊,請參閱 ClickOnce Security and DeploymentFor more information, see ClickOnce Security and Deployment.

檔案位置File location

部署資訊清單檔案會參考目前應用程式版本的正確應用程式資訊清單。The deployment manifest file references the correct application manifest for the current version of the application. 當您提供新版本的應用程式部署時,必須更新部署資訊清單才能參考新的應用程式資訊清單。When you make a new version of an application deployment available, you must update the deployment manifest to refer to the new application manifest.

部署資訊清單檔必須以強式名稱的方式命名,同時也可以包含發行者驗證的憑證。The deployment manifest file must be strongly named and can also contain certificates for publisher validation.

檔案名稱語法File name syntax

部署資訊清單的檔名必須以 .application 副檔名做為結尾。The name of a deployment manifest file must end with the .application extension.

範例Examples

下列程式碼範例會說明部署資訊清單。The following code example illustrates a deployment manifest.

<?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.v1="urn:schemas-microsoft-com:clickonce.v1"
  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:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <assemblyIdentity
    name="My Application Deployment.app"
    version="1.0.0.0"
    publicKeyToken="43cb1e8e7a352766"
    language="neutral"
    processorArchitecture="x86"
    xmlns="urn:schemas-microsoft-com:asm.v1" />
  <description
    asmv2:publisher="My Company Name"
    asmv2:product="My Application"
    xmlns="urn:schemas-microsoft-com:asm.v1" />
  <deployment install="true">
    <subscription>
      <update>
        <expiration maximumAge="0" unit="days" />
      </update>
    </subscription>
    <deploymentProvider codebase="\\myServer\sampleDeployment\MyApplicationDeployment.application" />
  </deployment>
  <compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
    <framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.20506" />
    <framework targetVersion="4.0" profile="Client" supportedRuntime="4.0.20506" />
  </compatibleFrameworks>
  <dependency>
    <dependentAssembly
      dependencyType="install"
      codebase="1.0.0.0\My Application Deployment.exe.manifest"
      size="6756">
      <assemblyIdentity
        name="My Application Deployment.exe"
        version="1.0.0.0"
        publicKeyToken="43cb1e8e7a352766"
        language="neutral"
        processorArchitecture="x86"
        type="win32" />
      <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>E506x9FwNauks7UjQywmzgtd3FE=</dsig:DigestValue>
      </hash>
    </dependentAssembly>
  </dependency>
<publisherIdentity name="CN=DOMAIN\MyUsername" issuerKeyHash="18312a18a21b215ecf4cdb20f5a0e0b0dd263c08" /><Signature Id="StrongNameSignature" xmlns="http://www.w3.org/2000/09/xmldsig#">
...
</Signature></asmv1:assembly>

另請參閱See also