Feature.xml 文件

适用于:SharePoint 2016 |SharePoint Foundation 2013 |SharePoint Online |SharePoint Server 2013

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

有关在何处创建文件以及如何实现Feature.xml文件的信息,请参阅 使用 SharePoint Foundation 中的功能

有关如何升级功能的信息,请参阅Upgrading Features

示例

下面的示例演示如何使用 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>

另请参阅