Sandbox Solutions in SharePoint 2010
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
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
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
Sandbox Limitations
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.
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.
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.
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.
No Support to WebPartPages Namespace - Sandbox won’t allow to use Microsoft.SharePoint.WebPartPages namespace.
No Support to external Webservice - Internet web service calls are not allowed to ensure security in Sandbox solutions.
No GAC Deployment - Sandbox solutions are not stored in File System(Physical path) and assemblies can’t be deployed to Global Assembly Cache(GAC).
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 Visual Webparts can be developed and deployed as sandbox Solutions.
0 comments:
Post a Comment