All About SharePoint 2010/2013

  Home  |   Contact  |   Syndication    |   Login
  23 Posts | 0 Stories | 0 Trackbacks


Exploring SharePoint 2013 Online

Developing Nintex Workflows

Exploring SharePoint 2013

Acquired MCPD : SharePoint 2010 Developer

Share on Facebook

Article Categories


Post Categories

Sandbox solution is a new feature introduced in SharePoint 2010. It's a secured wrapper around webparts and other elements with limitations. There is no thumb rule that every webpart in SharePoint 2010 belongs to Sandbox Solution. But it's recommended to develop webparts with Sandbox solution. It allows administrators to monitor the solutions and control as required. SharePoint Site Collection administrators can view the resource utilization of each solution and can block if it consumes too much resources. Usually when sites working slow, developers complain the server is slow whereas site/server administrators blame on Develepor code/solutions. Now Microsoft put a Full Stop to that. :)

Technically speaking SharePoint solutions run in seperate worker processes and not in w3wp.exe. So It doesn't require IIS Reset or Application Pool Recycling. Without disturbing the SharePoint site, Sandbox solutions can be deployed. Only thing while deploying new version of Sandbox solution over existing solution, SharePoint will display No Solution found error in Sandbox Webparts on the page. However within seconds sandbox solutions getting deployed and it'll start working. In SharePoint 2007, only farm administrators can install/deploy developer solutions. But Now site collection administrators can deploy solutions with web based interface. This reduces the dependency of Farm Administrator and improves rapid deployment.

Sandbox Processes
Here the processes which required for Sandbox solutions.
  1. SPUCWorkerprocess.exe - Sandbox Worker process service which is a Seperate Service Application which actually executes Sandbox code. It should be started in every farm to use Sandbox solutions.

  2. SPUCWorkerProcessProxy.exe - Sandbox Worker process proxy which is working as a proxy for Worker process and takes care of Sandbox code execution. It can also serve to other farms if configured. Basically it helps site administrator for load balancing.

  3. SPUCHostService.exe - Sandbox User Code Service takes care of user code in Sandbox amd it can be started in the farms where to use Sandbox solutions.
Sandbox Limitations
As I said before, Sandbox is a secured wrapper and it has restrictions on code to run in SharePoint environment. Few Key limitations which developers should know are listed below.
  1. No Security Elevation - RunWithElevatedPrivileges which runs the specified block of code in application pool account(typically System Account) context is not allowed in Sandbox code. SPSecurity class also not allowed to use in Sandbox.

  2. No Email Support - SPUtility.SendMail method has been blocked explicitly in Sandbox, However .Net mail classes can be used to send mails. Additionaly sandbox won't allow to read Farm SMTP address. So developers has to specify the SMTP address in code itself(may be some other workaround).

  3. No Support to WebPartPages Namespace - Sandbox won't allow to use Microsoft.SharePoint.WebPartPages namespace.

  4. No Support to external Webservice - Internet web service calls are not allowed to ensure security in Sandbox solutions. Allow Partially Trusted code also can't be accessed within Sandbox.

  5. No GAC Deployment - Sandbox solutions are not stored in File System(Physical path) and assemblies can't be deployed to Global Assembly Cache(GAC). But it's available on C:\ProgramData\Microsoft\SharePoint\UCCache at runtime. Note the ProgramData is a hidden folder.

  6. No Visual Webparts - Visual Studio 2010 by default won't allow to create Visual Webparts to deploy as sandbox solution. But with Visual Studio PowerTools extensions(downloadable from Microsoft MSDN website) Visual Webparts can be developed and deployed as sandbox Solutions.
SharePoint Online which is SharePoint environment provided by Microsoft to manage SharePoint Sites in internet accepts only Sandbox solutions. Because SharePoint Online sites are Windows Servers at Microsoft Datacenters, Microsoft won't allow GAC deployment or file system access. In future Sandbox solution will give more features for developers.

posted on Tuesday, November 23, 2010 10:55 AM


# re: What is Sandbox Solutions in SharePoint 2010? 11/23/2010 7:45 PM Ratgeber
There is no general rule that all Web Parts in SharePoint is part of the solution Sandbox. But it is recommended to develop Web Parts with a solution Sandbox. It allows administrators to monitor and control solutions as needed. SharePoint site managers can see the resource usage of each solution

# re: What is Sandbox Solutions in SharePoint 2010? 7/6/2011 9:48 AM Nick Sheldon
Hey Venkats.
i have tried to deploy a custom solution in the farm and the solution works fine, however when i check the ULS i dont see any workerprocess recoded(SPUCHostservices).I have enabled verbose logging for the sandbox code solution, still noting, can you provide any suggestions as to why i dont see any workerprocess related to the custom solution logged in the ULS.I do see the W3WP and the OWSTIMER.

# re: What is Sandbox Solutions in SharePoint 2010? 8/8/2011 5:39 PM Raj
Too good

# re: What is Sandbox Solutions in SharePoint 2010? 9/1/2011 3:23 PM web development
I really appreciate your professional approach. These are pieces of very useful information that will be of great use for me in future.

# re: What is Sandbox Solutions in SharePoint 2010? 9/21/2011 1:06 PM venkat
good work man!!! am spent 15 min over your blog...

# re: What is Sandbox Solutions in SharePoint 2010? 11/11/2011 5:31 PM web design company
You made some decent points there. I did a search on the topic and found most individuals will go along with with your website.

# re: What is Sandbox Solutions in SharePoint 2010? 2/2/2012 9:58 PM sst
Did you find a workaround about that in a sandbox solution :
SPUtility.TransferToErrorPage ???

# re: What is Sandbox Solutions in SharePoint 2010? 4/15/2012 2:54 AM Yogendra
Sandbox solution is good but after checking the limitations do you think it is a good thing to create web parts in sandbox solution environment.

1- NO email support
2- No security elevation
3- No gac deployments.

The above 3 options are really required in most of the cases when we develop a webpart.

Can somebody reply on this ?

# re: What is Sandbox Solutions in SharePoint 2010? 4/15/2012 2:55 PM Venkatesh
@Yogendra : If you really want to use those functionality then try Proxy class.

# re: What is Sandbox Solutions in SharePoint 2010 4/27/2012 11:03 AM Ubaid
Venkatesh, can you point to some resources for the proxy class?


Send unlimited free SMS to India! Check out now!

# re: What is Sandbox Solutions in SharePoint 2010? 5/29/2013 1:07 AM GMoney
Please spell check before you post an article - it's sad to find multiple typos.

# re: What is Sandbox Solutions in SharePoint 2010? 6/27/2013 6:47 PM Vinod
Hi Friends,
can anybody tell me that what we can do in sandbox which are not possible in farm. any example.

# re: What is Sandbox Solutions in SharePoint 2010? 6/27/2013 6:51 PM Venkatesh
Hi Vinod, Sandbox solutions can be managed by Site Administrators and can be deployed/retracted within the site (No need to access Central Admin site). Whereas Farm solutions has to be deployed in the server and activated via central admin site(By Farm Administrators).

# re: What is Sandbox Solutions in SharePoint 2010? 7/20/2013 3:19 AM Naveen
nice its useful me

# re: What is Sandbox Solutions in SharePoint 2010? 3/25/2014 6:20 PM kris
Good enough to learn a lot about this new and useful tool. - Kris Krohn Strongbrook

# re: What is Sandbox Solutions in SharePoint 2010? 4/23/2014 1:20 PM Sophia James
I am using free SharePoint site from Is this feature available in SharePoint 2013?

# re: What is Sandbox Solutions in SharePoint 2010? 5/17/2014 11:34 AM shiva
Excellent article!!"""""

comments powered by Disqus