Office 方案的應用程式資訊清單

應用程式資訊清單是描述載入至 Microsoft Office 方案之組件的 XML 檔案。 Visual Studio 中的 Microsoft Office Development Tools 會使用 ClickOnce 應用程式資訊清單參考中定義的 ClickOnce 應用程式資訊清單結構描述。

Office 方案的應用程式資訊清單會使用下列 ClickOnce 項目與屬性。

項目

描述

屬性

<assembly> 項目 (ClickOnce 應用程式)

必要項。 最上層項目。

manifestVersion

<assemblyIdentity> 項目 (ClickOnce 應用程式)

必要項。 識別 ClickOnce 應用程式的主要組件。

name

version

publicKeyToken

processorArchitecture

language

<trustInfo> 項目 (ClickOnce 應用程式)

識別應用程式的安全性需求。

None

<entryPoint> 項目 (ClickOnce 應用程式)

必要項。 識別執行的應用程式程式碼進入點 (Entry Point)。

name

dependencyName

customHostSpecified

<dependency> 項目 (ClickOnce 應用程式)

必要項。 識別要執行應用程式所需的每個相依性。 選擇性地識別需要預先安裝的組件。

None

<file> 項目 (ClickOnce 應用程式)

必要項。 識別應用程式所使用的每個非組件檔案。 可以包括與檔案相關聯的元件物件模型 (Component Object Model,COM) 隔離資料。

name

size

Office 方案的應用程式資訊清單在 co.v1 命名空間中具有下列項目。

<entryPoint>
    <co.v1:customHostSpecified />
</entryPoint> 

這些應用程式資訊清單在 vstav3 命名空間中也具有下列項目與屬性。

<addIn>
  <entryPointsCollection>
    <entryPoints>
      <entryPoint>
      </entryPoint>
    </entryPoints>
  </entryPointsCollection>
  <update></update>
  <postActions>
    <postAction>
      <postActionData>
      </postActionData>
    <postAction>
  </postActions>
  <application>
    <customizations>
      <customization>
      </customization>
    </customizations>
  </application
</addIn>

項目

描述

屬性

<customHostSpecified> 項目 (Visual Studio 中的 Office 程式開發)

必要項。 將資訊清單特別標記為 Office 方案。

None

<addin> 項目 (Visual Studio 中的 Office 程式開發)

必要項。 將進入點儲存至單一命名空間。

None

<entryPointsCollection> 項目 (Visual Studio 中的 Office 程式開發)

必要項。 群組一個或多個 Office 方案的所有組件。

id

<entryPoints> 項目 (Visual Studio 中的 Office 程式開發)

必要項。 群組所有組件以執行 Office 方案。

None

<entryPoint> 項目 (Visual Studio 中的 Office 程式開發)

必要項。 識別要在 Office 方案中執行的組件。

class

contract

<update> 項目 (Visual Studio 中的 Office 程式開發)

必要項。 設定方案的更新。

enabled

expiration

<postActions> 項目 (Visual Studio 中的 Office 程式開發)

選擇項。 群組在安裝 Office 方案後執行的所有部署後動作。

None

<postAction> 項目 (Visual Studio 中的 Office 程式開發)

選擇項。 識別部署後動作。

None

<postActionData> 項目 (Visual Studio 中的 Office 程式開發)

選擇項。 設定部署後動作的資料。

None

<application> 項目 (Visual Studio 中的 Office 程式開發)

必要項。 將應用程式特定的資訊包裝至單一節點。

None

<customizations> 項目 (Visual Studio 中的 Office 程式開發)

必要項。 將所有應用程式主機特定的資訊儲存至不同的命名空間。

None

<customization> 項目 (Visual Studio 中的 Office 程式開發)

必要項。 將應用程式主機特定的資訊儲存至不同的命名空間。

xmlns

<document> 項目 (Visual Studio 中的 Office 程式開發)

文件層級的方案才需要。 儲存自訂的特定資訊。

solutionId

<appAddin> 項目 (Visual Studio 中的 Office 程式開發)

應用程式層級的方案才需要。 儲存自訂的特定資訊。

application

loadBehavior

keyName

<friendlyName> 項目 (Visual Studio 中的 Office 程式開發)

選擇項。 儲存出現在已安裝之增益集清單中的增益集名稱。

None

<description> 項目 (Visual Studio 中的 Office 程式開發)

應用程式層級的增益集才需要。 儲存出現在已安裝之程式清單中的描述。

None

<formRegions> 項目 (Visual Studio 中的 Office 程式開發)

只有包含表單區域的 Outlook 2007 增益集才需要。

None

<formRegion> 項目 (Visual Studio 中的 Office 程式開發)

只有包含表單區域的 Outlook 2007 增益集才需要。

Name

<vstoRuntime> 項目 (Visual Studio 中的 Office 程式開發)

必要項。 描述 Office 方案支援的特定 Visual Studio Tools for Office Runtime 版本。

release

version

supportUrl

備註

您可以手動編輯 Office 方案中的應用程式和部署資訊清單, 之後必須使用「資訊清單產生和編輯工具」(mage.exe 和 mageui.exe),重新簽署應用程式與部署資訊清單。 如需詳細資訊,請參閱HOW TO:重新簽署應用程式和部署資訊清單

檔案位置

應用程式資訊清單是方案的單一版本所特有的。 因此,應用程式資訊清單應該與部署資訊清單分開儲存。 Visual Studio 會將版本特定的檔案,放在發行資料夾中與其 Application Files 子目錄相關聯之版本所命名的子目錄中。

檔名語法

應用程式資訊清單的檔名應該是 assemblyIdentity 項目中識別的應用程式完整名稱和副檔名,其後接著副檔名 .manifest。 例如,參考 OutlookAddIn1.dll 自訂的應用程式資訊清單會使用下列檔案名稱語法。

OutlookAddIn1.dll.manifest

文件層級自訂範例

描述

下列程式碼範例會示範 Visual Studio Tools for Office 方案所專屬的應用程式資訊清單區段。 這個範例說明 Microsoft Office Excel 2007 的文件層級自訂。

程式碼

<entryPoint>
    <co.v1:customHostSpecified />
</entryPoint> 
[...]
<vstav3:addIn 
  xmlns:vstav3="urn:schemas-microsoft-com:vsta.v3">
  <vstav3:entryPointsCollection>
    <vstav3:entryPoints>
      <vstav3:entryPoint 
        class="ContosoExcelWorkbook.ThisWorkbook">
        <assemblyIdentity 
          name="ContosoExcelWorkbook" 
          version="1.0.0.0" 
          language="neutral" 
          processorArchitecture="msil" />
      </vstav3:entryPoint>
      <vstav3:entryPoint 
        class="ContosoExcelWorkbook.Sheet1">
        <assemblyIdentity 
          name="ContosoExcelWorkbook" 
          version="1.0.0.0" 
          language="neutral" 
          processorArchitecture="msil" />
      </vstav3:entryPoint>
      <vstav3:entryPoint 
        class="ContosoExcelWorkbook.Sheet2">
        <assemblyIdentity 
          name="ContosoExcelWorkbook" 
          version="1.0.0.0" 
          language="neutral" 
          processorArchitecture="msil" />
      </vstav3:entryPoint>
      <vstav3:entryPoint 
        class="ContosoExcelWorkbook.Sheet3">
        <assemblyIdentity 
          name="ContosoExcelWorkbook" 
          version="1.0.0.0" 
          language="neutral" 
          processorArchitecture="msil" />
      </vstav3:entryPoint>
    </vstav3:entryPoints>
  </vstav3:entryPointsCollection>
  <vstav3:update 
    enabled="true">
    <vstav3:expiration 
      maximumAge="7" 
      unit="days" />
  </vstav3:update>
  <vstav3:application>
    <vstov4:customizations 
      xmlns:vstov4="urn:schemas-microsoft-com:vsto.v4">
      <vstov4:customization>
        <vstov4:document 
          solutionId="73e" />
      </vstov4:customization>
    </vstov4:customizations>
  </vstav3:application>
</vstav3:addIn>

應用程式層級增益集範例

描述

下列程式碼範例會示範 Visual Studio Tools for Office 方案所專屬的應用程式資訊清單區段。 這個範例說明包含表單區域的 Microsoft Office Outlook 2007 應用程式層級增益集。

程式碼

<entryPoint>
    <co.v1:customHostSpecified />
</entryPoint> 
[...]
<vstav3:addIn 
  xmlns:vstav3="urn:schemas-microsoft-com:vsta.v3">
  <vstav3:entryPointsCollection>
    <vstav3:entryPoints>
      <vstav3:entryPoint 
        class="ContosoOutlookAddIn.ThisAddIn">
        <assemblyIdentity 
          name="ContosoOutlookAddIn" 
          version="1.0.0.0" 
          language="neutral" 
          processorArchitecture="msil" />
      </vstav3:entryPoint>
    </vstav3:entryPoints>
  </vstav3:entryPointsCollection>
  <vstav3:update 
    enabled="true">
    <vstav3:expiration 
      maximumAge="7" 
      unit="days" />
  </vstav3:update>
  <vstav3:application>
    <vstov4:customizations 
      xmlns:vstov4="urn:schemas-microsoft-com:vsto.v4">
      <vstov4:customization>
        <vstov4:appAddIn 
          application="Outlook" 
          loadBehavior="3" 
          keyName="ContosoOutlookAddIn">
          <vstov4:friendlyName>
            ContosoOutlookAddIn
          </vstov4:friendlyName>
          <vstov4:description>
            ContosoOutlookAddIn - Outlook add-in 
            created with Visual Studio Tools for Office
          </vstov4:description>
          <vstov4:formRegions>
            <vstov4:formRegion
                name="OutlookAddIn1.FormRegion1">
              <vstov4:messageClass name="IPM.Note" />
              <vstov4:messageClass name="IPM.Contact" />
              <vstov4:messageClass name="IPM.Appointment" />
            </vstov4:formRegion>
          </vstov4:formRegions>
        </vstov4:appAddIn>
      </vstov4:customization>
    </vstov4:customizations>
  </vstav3:application>
</vstav3:addIn>

多重專案部署範例

描述

下列程式碼範例會示範 Visual Studio Tools for Office 方案所專屬的應用程式資訊清單區段。 這個範例說明多重專案部署工作,它會安裝包含表單區域的 Microsoft Outlook 2007 應用程式層級增益集以及 Microsoft Excel 2007 文件層級自訂。

程式碼

  <entryPoint>
    <co.v1:customHostSpecified />
  </entryPoint>
[...]
  <dependency>
    <dependentAssembly 
      dependencyType="install" 
      allowDelayedBinding="true" 
      codebase="ContosoExcelWorkbook.dll" 
      size="12800">
      <assemblyIdentity 
        name="ContosoExcelWorkbook" 
        version="1.0.0.0" 
        language="neutral" 
        processorArchitecture="msil" />
      <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>ONF</dsig:DigestValue>
      </hash>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly 
      dependencyType="install" 
      allowDelayedBinding="true" 
      codebase="ContosoOutlookAddIn.dll" 
      size="10240">
      <assemblyIdentity 
        name="ContosoOutlookAddIn" 
        version="1.0.0.0" 
        language="neutral" 
        processorArchitecture="msil" />
      <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>i4e</dsig:DigestValue>
      </hash>
    </dependentAssembly>
  </dependency>
  <vstav3:addIn 
    xmlns:vstav3="urn:schemas-microsoft-com:vsta.v3">
    <vstav3:entryPointsCollection>
      <vstav3:entryPoints 
        id="ContosoExcel">
        <vstav3:entryPoint 
          class="ContosoExcelWorkbook.ThisWorkbook">
          <assemblyIdentity 
            name="ContosoExcelWorkbook" 
            version="1.0.0.0" 
            language="neutral" 
            processorArchitecture="msil" />
        </vstav3:entryPoint>
        <vstav3:entryPoint 
          class="ContosoExcelWorkbook.Sheet1">
          <assemblyIdentity 
            name="ContosoExcelWorkbook" 
            version="1.0.0.0" 
            language="neutral" 
            processorArchitecture="msil" />
        </vstav3:entryPoint>
        <vstav3:entryPoint 
          class="ContosoExcelWorkbook.Sheet2">
          <assemblyIdentity 
            name="ContosoExcelWorkbook" 
            version="1.0.0.0" 
            language="neutral" 
            processorArchitecture="msil" />
        </vstav3:entryPoint>
        <vstav3:entryPoint 
          class="ContosoExcelWorkbook.Sheet3">
          <assemblyIdentity 
            name="ContosoExcelWorkbook" 
            version="1.0.0.0" 
            language="neutral" 
            processorArchitecture="msil" />
        </vstav3:entryPoint>
      </vstav3:entryPoints>
      <vstav3:entryPoints 
        id="ContosoOutlook">
        <vstav3:entryPoint 
          class="ContosoOutlookAddIn.ThisAddIn">
          <assemblyIdentity 
            name="ContosoOutlookAddIn" 
            version="1.0.0.0" 
            language="neutral" 
            processorArchitecture="msil" />
        </vstav3:entryPoint>
      </vstav3:entryPoints>
    </vstav3:entryPointsCollection>
    <vstav3:update 
      enabled="true">
      <vstav3:expiration 
        maximumAge="7" 
        unit="days" />
    </vstav3:update>
    <vstav3:application>
      <vstov4:customizations 
        xmlns:vstov4="urn:schemas-microsoft-com:vsto.v4">
        <vstov4:customization 
          id="ContosoExcel">
          <vstov4:document 
            solutionId="73ec4ba9-a983-40b3-af63-5fb172ea81db" />
        </vstov4:customization>
        <vstov4:customization 
          id="ContosoOutlook">
          <vstov4:appAddIn 
            application="Outlook" 
            loadBehavior="3" 
            keyName="ContosoOutlookAddIn">
            <vstov4:friendlyName>
              ContosoOutlookAddIn
            </vstov4:friendlyName>
            <vstov4:description>
              ContosoOutlookAddIn - Outlook add-in created with 
              Visual Studio Tools for Office
            </vstov4:description>
          </vstov4:appAddIn>
        </vstov4:customization>
      </vstov4:customizations>
    </vstav3:application>
  </vstav3:addIn>

部署後動作範例

描述

下列程式碼範例會示範 Visual Studio Tools for Office 方案所專屬的應用程式資訊清單區段。 這個範例說明會在安裝完成後建立登錄機碼的部署後動作。

程式碼

<vstav3:postActions>
  <vstav3:postAction>
    <vstav3:entryPoint 
      class="PostDeploymentAction.PostDeploymentActionSample">
      <assemblyIdentity 
        name="PostDeploymentAction" 
        version="1.0.0.0" 
        language="neutral" 
        processorArchitecture="msil" />
    </vstav3:entryPoint>
    <vstav3:postActionData>
    </vstav3:postActionData>
  </vstav3:postAction>
</vstav3:postActions>

請參閱

參考

Office 方案的部署資訊清單

ClickOnce 應用程式資訊清單