Поделиться через


How to: Add and Remove Feature Dependencies

Your SharePoint Feature may depend on other Features for functionality or data. In these cases, you can mark these other Features as dependencies for your Feature. This way, the SharePoint server ensures that dependent Features are activated before your Feature is activated.

Adding Dependencies

You can add other Features in your solution as dependencies. This way, you can make sure that required Features are installed and activated before your feature is installed.

To add a dependency on a Feature in the solution

  1. Open the Feature Designer.

  2. Click the arrow next to Feature Activation Dependencies.

  3. Click the Add button.

    The Add Feature Activation Dependencies dialog box appears.

  4. Click Add a dependency on features in the solution.

  5. Click the title of the feature that you want to add as a dependency. For more than one feature, hold the CTRL key and click several feature names.

  6. Click the Add button.

Adding Custom Dependencies

You can add Features that are already deployed on a SharePoint server as a dependency. This way, the SharePoint activation process checks to make sure that all dependent Features are activated before your Feature is installed.

To add a dependency by the Feature ID

  1. Open the Feature Designer.

  2. Click the arrow next to Feature Activation Dependencies.

  3. Click the Add button.

    The Add Feature Activation Dependencies dialog box opens.

  4. Click Add a custom dependency.

  5. In the Feature ID text box, enter the GUID for the Feature that you want to mark as an activation dependency.

  6. Click the Add button.

Editing Custom Dependencies

You can edit custom dependencies that you added previously. However, dependent Features that are in your solution can only be removed, not edited.

To change a dependency on a Feature in the solution

  1. Open the Feature Designer.

  2. Click the arrow next to Feature Activation Dependencies.

  3. Click the name of the feature that you want to remove.

  4. Click the Edit button.

    The Edit Custom Feature Activation Dependency dialog box appears.

  5. Change the title, Feature ID, or description.

  6. Click Submit.

Removing Dependencies

To remove a dependency on a Feature in the solution

  1. Open the Feature Designer.

  2. Click the arrow next to Feature Activation Dependencies.

  3. Click the name of the feature that you want to remove.

  4. Click the Remove button.

See Also

Tasks

How to: Customize a SharePoint Feature

How to: Add and Remove Items to SharePoint Features

Other Resources

Creating SharePoint Features