SPSolutionCollection Class

Represents a collection of SPSolution objects.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPPersistedObjectCollection<SPSolution>
    Microsoft.SharePoint.Administration.SPPersistedChildCollection<SPSolution>
      Microsoft.SharePoint.Administration.SPSolutionCollection

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPSolutionCollection _
    Inherits SPPersistedChildCollection(Of SPSolution) _
    Implements IBackupRestoreConfiguration, IBackupRestore
'Usage
Dim instance As SPSolutionCollection
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPSolutionCollection : SPPersistedChildCollection<SPSolution>, 
    IBackupRestoreConfiguration, IBackupRestore

Remarks

Use the Solutions property of the SPFarm class to get the collection of solutions installed in the server farm. To add a solution to the collection, use the Add method.

Important

Using the SPSolution constructor to create a solution object is not supported and returns a NullReferenceException if you attempt to implement members of an object created through the constructor.

Use an indexer to return a single solution from the collection. For example, if the collection is assigned to a variable named myDefinitions, use myDefinitions[index] in C#, or myDefinitions(index) in Visual Basic, where index is the GUID of the Solution.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

SPSolutionCollection Members

Microsoft.SharePoint.Administration Namespace