<compatibleFrameworks>項目 (ClickOnce 部署)<compatibleFrameworks> element (ClickOnce deployment)

識別安裝及執行此應用程式所需的 .NET Framework 版本。Identifies the versions of the .NET Framework where this application can install and run.

Note

MageUI.exe 不支援compatibleFrameworks憑證,使用已簽署項目儲存應用程式資訊清單時 MageUI.exeMageUI.exe does not support the compatibleFrameworks element when saving an application manifest that has already been signed with a certificate using MageUI.exe. 您必須改用 Mage.exeInstead, you must use Mage.exe.

語法Syntax

<compatibleFrameworks
      SupportUrl> 
   <framework
      targetVersion
      profile
      supportedRuntime
   /> 
</ compatibleFrameworks>

元素和屬性Elements and attributes

compatibleFrameworks項目時,需要部署資訊清單目標ClickOnceClickOnce提供由.NET Framework 4 或更新版本的執行階段。The compatibleFrameworks element is required for deployment manifests that target the ClickOnceClickOnce runtime provided by .NET Framework 4 or later. compatibleFrameworks元素包含一或多個framework項目會指定此應用程式可以執行所在的.NET Framework 版本。The compatibleFrameworks element contains one or more framework elements that specify the .NET Framework versions on which this application can run. ClickOnceClickOnce執行階段將執行應用程式在第一個可用framework這份清單中。The ClickOnceClickOnce runtime will run the application on the first available framework in this list.

下表列出屬性,compatibleFrameworks項目支援。The following table lists the attribute that the compatibleFrameworks element supports.

屬性Attribute 描述Description
S upportUrlS upportUrl 選擇性。Optional. 指定的 URL,可以下載相容的慣用的.NET Framework 版本的位置。Specifies a URL where the preferred compatible .NET Framework version can be downloaded.

架構framework

必要項。Required. 下表列出的屬性,framework項目支援。The following table lists the attributes that the framework element supports.

屬性Attribute 描述Description
targetVersion 必要項。Required. 指定的目標.NET Framework 的版本號碼。Specifies the version number of the target .NET Framework.
profile 必要項。Required. 指定的目標.NET Framework 的設定檔。Specifies the profile of the target .NET Framework.
supportedRuntime 必要項。Required. 指定執行階段相關聯的目標.NET Framework 的版本號碼。Specifies the version number of the runtime associated with the target .NET Framework.

備註Remarks

範例Example

下列程式碼範例所示compatibleFrameworks中的項目ClickOnceClickOnce部署資訊清單。The following code example shows a compatibleFrameworks element in a ClickOnceClickOnce deployment manifest. 可以執行此部署.NET Framework 4 Client Profile.NET Framework 4 Client ProfileThis deployment can run on the .NET Framework 4 Client Profile.NET Framework 4 Client Profile. 因為它的超集時,它可以也在.NET Framework 4 上執行.NET Framework 4 Client Profile.NET Framework 4 Client ProfileIt can also run on the .NET Framework 4 because it is a superset of the .NET Framework 4 Client Profile.NET Framework 4 Client Profile.

<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework
      targetVersion="4.0"
      profile="Client"
      supportedRuntime="4.0.30319" />
</compatibleFrameworks>

另請參閱See also