Monday 14 May 2012

How to escape Restrictions on Sandbox Solutions in SharePoint


In addition to my previous tip about How to Disable Sandbox Solutions on your SharePoint site I would like to Share another tip about how to escape Restrictions on Sandbox Solutions in SharePoint.

Override Sandbox Restrictions - There are two major ways that a sandboxed solution can escape the usual restrictions.

1. Using Client-side code - To access the resources that are not available from server-side code in a sandboxed solution you can use the client-side object model available. The benefit of using this object model is that there are no code execution restrictions, no resource access restrictions, and no resource usage restrictions.
2.  Full trust proxy (SPProxyOperation) - The sandboxed solutions architecture also enables a technique by which a sandboxed solution can call custom operations that run in full trust. The technique requires that a farm solution be developed that includes one or more classes that derive from
SPProxyOperation. Each of these defines an operation that will run in full trust and can be called from sandboxed solutions by means of the ExecuteRegisteredProxyOperation method. Specifically, these full trust proxy operations execute in the same proxy process (SPUCWorkerProcessProxy.exe) in which the standard Microsoft.SharePoint.dll assembly runs. The proxy operations can return data to the sandboxed solution.
 
Check the Example here to Create a Full-Trust Proxy Operation.



Ads by Google

No comments:

Post a Comment