Sandbox Solution service on the server

To enable the Sharepoint server to run/execute Sandbox Solution, go to Central Administration à System settings à Manager services on server, and start the service “Microsoft Sharepoint Foundation Sandbox Code service”.

To enable the Sharepoint server to run/execute Sandbox Solution, go to Central Administration à System settings à Manager user Solutions, in the Loadin Balancing section, you can configure where the sandbox solution should run – either on the servicer where they’re requested, or on other available servers with Solution Code service running.

Sanbox solution runs ina separate than w3wp.exe, that’s why the application pool doesn’t have to be re-started every time a sanbox solution is deployed.

SPUCWorkerprocess.exe is the name of the process to attach to while debugging.

When a solutionis made a “Sandbox Solution”, VS 2010 will intentionally hide (in intellisense) the functions/features that are not suppoorted in sanbox solution mode – although you still can type in theose unsupported methods, they just won’t execute after deployment.

To verify that your sandbox solutions compiles and is executable, add a reference to [SharePoint Root]\UserCode\assemblies\Microsoft.SharePoint.dll

Before deploying, change the reference to the Microsoft.SharePoint.dll in the [SharePoint Root]\ISAPI folder

To see how well your site collections’ sandbox solutions perform/behave, so to site collection’s Site Actions à Site Settings à Solutions.

For a farm administrator to decide how many “points” you should have, go to Central Administration à Application Management à Configure Quotas and Locks.

Your entire site collection has been allocated a certain number of points to be shared across all sandbox solutions. If one of those solutions ends up using all of those points, all of those sandbox solutions are shut down for about a day.

There are 14 metrics that are monitored by SharePoint regarding the performance of your site collections’s sandbox solutions.

Farm administrator can manually select a sandbox solution to block, by going to Central Administration à System settings à Manage User Solutions. Browse to the solution package and add it to the blocked solutions list.

Farm administrator can deploy solution validator to valid all existing (next time they’re executed) or new (when uploaded but before activated) sandbox solutions. The solution validation would inherit from SPSolutionValidator class. Once completed, add the solution validator to the SPUserCodeservice Solution Validator collection.

Since Sandbox solutionis restricted due to various reasons, it is still possible to allow the sandbox solution to perform a task that’s normally not allowed – such as writing a file to disk. Do tis by using Sandbox Full trust Proxy. 5 steps:

1. Decide what operations you need to perform in the proxy class, which is inherited from Microsoft.SharePoint.Usercode.SPProxyOperation.
2. Choose what arguments will be passed to the proxy class. The args are inherited from Microsoft.SharePoint.Usercode.SPProxyOperationArgs.
3. Compile the proxy, strong name it, and put it in GAC.
4. Register the proxy with Sharepoint.
5. Consume the proxy in your sandbox solution using the SPUtility.ExecuteRegisteredProxyOperation method.

Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: