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)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
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