SPFeatureCollection.Remove method (Guid, Boolean)

Removes the Feature with the specified GUID from the collection and optionally ignores errors.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Sub Remove ( _
    featureId As Guid, _
    force As Boolean _
)
'Usage
Dim instance As SPFeatureCollection
Dim featureId As Guid
Dim force As Boolean

instance.Remove(featureId, force)
public void Remove(
    Guid featureId,
    bool force
)

Parameters

  • featureId
    Type: System.Guid

    The ID of the Feature to remove.

  • force
    Type: System.Boolean

    true to force the operation and ignore errors; otherwise, false.

Exceptions

Exception Condition
InvalidOperationException

The Feature is not activated.

ArgumentException

The error Feature was not found.

-or-

The Feature is not installed and the force operation is not specified.

Remarks

This method deactivates the specified Feature after it has removed it from the collection.

See also

Reference

SPFeatureCollection class

SPFeatureCollection members

Remove overload

Microsoft.SharePoint namespace