Bagikan melalui


Application Manifests for Office Solutions

An application manifest is an XML file that describes the assemblies that are loaded into a Microsoft Office solution. The Microsoft Office development tools in Visual Studio use the ClickOnce application manifest schema defined in the ClickOnce Application Manifest reference.

Application manifests for Office solutions use the following ClickOnce elements and attributes.

Element

Description

Attributes

<assembly> Element (ClickOnce Application)

Required. Top-level element.

manifestVersion

<assemblyIdentity> Element (ClickOnce Application)

Required. Identifies the ClickOnce application's primary assembly.

name

version

publicKeyToken

processorArchitecture

language

<trustInfo> Element (ClickOnce Application)

Identifies the application security requirements.

None

<entryPoint> Element (ClickOnce Application)

Required. Identifies the application code entry point for execution.

name

dependencyName

customHostSpecified

<dependency> Element (ClickOnce Application)

Required. Identifies each dependency required for the application to run. Optionally identifies assemblies that need to be preinstalled.

None

<file> Element (ClickOnce Application)

Required. Identifies each non-assembly file that is used by the application. Can include Component Object Model (COM) isolation data associated with the file.

name

size

Application manifests for Office solutions have the following element in the co.v1 namespace.

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

These application manifests also have the following elements and attributes in the vstav3 namespace.

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

Element

Description

Attributes

<customHostSpecified> Element (Office Development in Visual Studio)

Required. Marks the manifest specifically as an Office solution.

None

<addin> Element (Office Development in Visual Studio)

Required. Stores entry points into a single namespace.

None

<entryPointsCollection> Element (Office Development in Visual Studio)

Required. Groups all the assemblies for one or more Office solutions.

id

<entryPoints> Element (Office Development in Visual Studio)

Required. Groups all the assemblies to run an Office solution.

None

<entryPoint> Element (Office Development in Visual Studio)

Required. Identifies the assembly to run in an Office solution.

class

contract

<update> Element (Office Development in Visual Studio)

Required. Configures updates for the solution.

enabled

expiration

<postActions> Element (Office Development in Visual Studio)

Optional. Groups all the post-deployment actions, which run after Office solutions are installed.

None

<postAction> Element (Office Development in Visual Studio)

Optional. Identifies a post-deployment action.

None

<postActionData> Element (Office Development in Visual Studio)

Optional. Configures data for a post-deployment action.

None

<application> Element (Office Development in Visual Studio)

Required. Wraps the application-specific information into a single node.

None

<customizations> Element (Office Development in Visual Studio)

Required. Stores all application host-specific information in a separate namespace.

None

<customization> Element (Office Development in Visual Studio)

Required. Stores application host-specific information in a separate namespace.

xmlns

<document> Element (Office Development in Visual Studio)

Required only for document-level solutions. Stores customization-specific information.

solutionId

<appAddin> Element (Office Development in Visual Studio)

Required only for application-level solutions. Stores customization-specific information.

application

loadBehavior

keyName

<friendlyName> Element (Office Development in Visual Studio)

Optional. Stores the name of the add-in that appears in the list of installed add-ins.

None

<description> Element (Office Development in Visual Studio)

Required only for application-level add-ins. Stores the description that appears in the list of installed programs.

None

<formRegions> Element (Office Development in Visual Studio)

Required only for Outlook 2007 add-ins that include form regions.

None

<formRegion> Element (Office Development in Visual Studio)

Required only for Outlook 2007 add-ins that include form regions.

Name

<vstoRuntime> Element (Office Development in Visual Studio)

Required. Describes a specific version of the Visual Studio Tools for Office runtime that is supported by the Office solution.

release

version

supportUrl

Remarks

You can manually edit application and deployment manifests in Office solutions. Afterwards, you must re-sign the application and deployment manifests by using the Manifest Generation and Editing Tool (mage.exe and mageui.exe). For more information, see How to: Re-sign Application and Deployment Manifests.

File Location

An application manifest is specific to a single version of a solution. For this reason, application manifests should be stored separately from deployment manifests. Visual Studio places the version-specific files in a subdirectory named after the associated version in the Application Files subdirectory in the publish folder.

File Name Syntax

The name of an application manifest file should be the full name and extension of the application as identified in the assemblyIdentity element, followed by the extension .manifest. For example, an application manifest that refers to the OutlookAddIn1.dll customization would use the following file name syntax.

OutlookAddIn1.dll.manifest

Document-Level Customization Example

Description

The following code example illustrates the sections of an application manifest that are specific to a Visual Studio Tools for Office solution. This example describes a Microsoft Office Excel 2007 document-level customization.

Code

<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>

Application-Level Add-in Example

Description

The following code example illustrates the sections of an application manifest that are specific to a Visual Studio Tools for Office solution. This example describes a Microsoft Office Outlook 2007 application-level add-in that includes a form region.

Code

<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>

Multi-Project Deployment Example

Description

The following code example illustrates the sections of an application manifest that are specific to a Visual Studio Tools for Office solution. This example describes a multi-project deployment that installs a Microsoft Outlook 2007 application-level add-in with a form region and a Microsoft Excel 2007 document-level customization.

Code

  <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>

Post-Deployment Actions Example

Description

The following code example illustrates the sections of an application manifest that are specific to a Visual Studio Tools for Office solution. This example describes a post-deployment action that creates a registry key after installation is complete.

Code

<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>

See Also

Reference

Deployment Manifests for Office Solutions

ClickOnce Application Manifest