Feature.xml 文件

上次修改时间: 2010年4月6日

适用范围: SharePoint Foundation 2010

在 Feature.xml 文件中,Feature 元素定义一个功能,并指定支持该功能的程序集、文件、依赖项或属性的位置。

Feature

  ActivationDependencies

    ActivationDependency

  ElementManifests

    ElementFile

    ElementManifest

Properties

Property

  UpgradeActions 元素(功能)

    AddContentTypeField 元素(功能)

    ApplyElementManifests 元素(功能)

      ElementFile 元素(功能)

      ElementManifest 元素(功能)

    CustomUpgradeAction 元素(功能)

      Parameters 元素(功能)

        Parameter 元素(功能)

    MapFile 事件(功能)

    VersionRange 元素(功能)

      AddContentTypeField 元素(功能)

      ApplyElementManifests 元素(功能)

      CustomUpgradeAction 元素(功能)

      MapFile 事件(功能)

有关 Feature.xml 文件的创建位置和实现方式的信息,请参阅使用功能。有关如何升级功能的信息,请参阅升级功能

示例

下面的示例演示如何使用 Feature.xml 文件指定激活依赖项、特殊字段和元素定义文件的相对路径。

<Feature 
  Id="11111111-1111-1111-1111-11111111111" 
  Title="Location Services"
  Description="This Feature contains lists and parts that let you link location data to your customer lists."
  Scope="Web">
  <ActivationDependencies>
    <ActivationDependency
      FeatureId="11111111-1111-1111-1111-111111111111" />
  </ActivationDependencies>
  <ElementManifests>
    <ElementManifest 
      Location="Location\LocationPart.xml"/>
    <ElementManifest 
      Location="CustomerLocation\CustomerLocationList.xml"/>
    <ElementFile 
      Location="test.aspx"/>
  </ElementManifests>
  <Properties>
    <Property
      Key="Color"
      Value="Blue"/>
    <Property
      Key="Shape"
      Value="Triangle"/>
  </Properties> 
</Feature>

请参阅

概念

使用功能