Geeks With Blogs
Sharep10nt All About SharePoint 2010/2013
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 | Back to top


Comments on this post: What is Sandbox Solutions in SharePoint 2010?

# re: What is Sandbox Solutions in SharePoint 2010?
Requesting Gravatar...
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
Left by Ratgeber on Nov 23, 2010 7:45 PM

# re: What is Sandbox Solutions in SharePoint 2010?
Requesting Gravatar...
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.
Left by Nick Sheldon on Jul 06, 2011 9:48 AM

# re: What is Sandbox Solutions in SharePoint 2010?
Requesting Gravatar...
Too good
Left by Raj on Aug 08, 2011 5:39 PM

# re: What is Sandbox Solutions in SharePoint 2010?
Requesting Gravatar...
I really appreciate your professional approach. These are pieces of very useful information that will be of great use for me in future.
Left by web development on Sep 01, 2011 3:23 PM

# re: What is Sandbox Solutions in SharePoint 2010?
Requesting Gravatar...
good work man!!! am spent 15 min over your blog...
Left by venkat on Sep 21, 2011 1:06 PM

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

# re: What is Sandbox Solutions in SharePoint 2010?
Requesting Gravatar...
Did you find a workaround about that in a sandbox solution :
SPUtility.TransferToErrorPage ???
Left by sst on Feb 02, 2012 9:58 PM

# re: What is Sandbox Solutions in SharePoint 2010?
Requesting Gravatar...
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 ?
Left by Yogendra on Apr 15, 2012 2:54 AM

# re: What is Sandbox Solutions in SharePoint 2010?
Requesting Gravatar...
@Yogendra : If you really want to use those functionality then try Proxy class.
Left by Venkatesh on Apr 15, 2012 2:55 PM

# re: What is Sandbox Solutions in SharePoint 2010
Requesting Gravatar...
Venkatesh, can you point to some resources for the proxy class?

Thanks,
Ubaid

--------------
Send unlimited free SMS to India! Check out now!
Left by Ubaid on Apr 27, 2012 11:03 AM

# re: What is Sandbox Solutions in SharePoint 2010?
Requesting Gravatar...
Please spell check before you post an article - it's sad to find multiple typos.
Left by GMoney on May 29, 2013 1:07 AM

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

# re: What is Sandbox Solutions in SharePoint 2010?
Requesting Gravatar...
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).
Left by Venkatesh on Jun 27, 2013 6:51 PM

# re: What is Sandbox Solutions in SharePoint 2010?
Requesting Gravatar...
nice its useful me
Left by Naveen on Jul 20, 2013 3:19 AM

# re: What is Sandbox Solutions in SharePoint 2010?
Requesting Gravatar...
Good enough to learn a lot about this new and useful tool. - Kris Krohn Strongbrook

Left by kris on Mar 25, 2014 6:20 PM

# re: What is Sandbox Solutions in SharePoint 2010?
Requesting Gravatar...
I am using free SharePoint site from http://www.cloudappsportal.com. Is this feature available in SharePoint 2013?
Left by Sophia James on Apr 23, 2014 1:20 PM

# re: What is Sandbox Solutions in SharePoint 2010?
Requesting Gravatar...
Excellent article!!"""""
Left by shiva on May 17, 2014 11:34 AM

comments powered by Disqus

Copyright © venkatx5 | Powered by: GeeksWithBlogs.net | Join free