SPFeatureReceiverProperties.UserCodeSite property

Gets an SPSite object that represents the site collection where a sandboxed solution that includes this feature is deployed, or gets a null reference (Nothing in Visual Basic) if the solution is a farm solution.

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

Syntax

'Declaration
Public ReadOnly Property UserCodeSite As SPSite
    Get
'Usage
Dim instance As SPFeatureReceiverProperties
Dim value As SPSite

value = instance.UserCodeSite
public SPSite UserCodeSite { get; }

Property value

Type: Microsoft.SharePoint.SPSite
If the solution that contains the feature is a farm solution, the property returns a null reference (Nothing in Visual Basic). If the feature is a sandboxed solution, the property returns an SPSite object that represents the site collection where a solution is deployed.

Remarks

You can use the UserCodeSite property to determine the site collection where a sandboxed solution that includes the current feature is deployed.

See also

Reference

SPFeatureReceiverProperties class

SPFeatureReceiverProperties members

Microsoft.SharePoint namespace

Other resources

Sandboxed Solutions