Sandboxed Solutions are the development paradigm for SharePoint Online. In this session, you’ll learn about sandboxed solutions including how to develop, debug and deploy solutions. You’ll also learn the breadth of solutions that can be developed in the sandbox and strategies for developing common scenarios that are not enabled in the sandbox. We are going to discuss tools that can help us develop solutions in a sandbox and tricks that can assist us to streamline code development and application life cycle. The session will be accompanied with series of demoes that are going to show some of best and worst practices with SharePoint solutions.
11. Request Flow
FRONT END BACK END
Execution Manager Host Services
(Inside Application Pool) (SPUCHostService.exe)
IIS Worker Service
(WPW3.EXE) (SPUCWorkerProcess.exe)
Subset-Model
Full-Model
Request
Request
12. Supported in Sandboxed
Solutions
• Web Parts (no Visual WPs)
• Lists
• List Templates
• Custom Actions
• Workflows
• Event Receivers
• Content Types
• Site Columns
• …
Source: http://msdn.microsoft.com/en-us/library/ff872402.aspx
13. Supported API
• All of the Microsoft.SharePoint namespace, except:
– SPSite constructor
– SPSecurity object
– SPWorkItem and SPWorkItemCollection objects
– SPAlertCollection.Add method
– SPAlertTemplateCollection.Add method
– SPUserSolution and SPUserSolutionCollection objects
– SPTransformUtilities object
– Microsoft.SharePoint.Navigation namespace
• All of the Microsoft.SharePoint.Utilities namespace, except
– SPUtility.SendEmail method
– SPUtility.GetNTFullNameandEmailFromLogin method
– Microsoft.SharePoint.Workflow namespace
• All of the Microsoft.SharePoint.WebPartPages namespace, except
– SPWebPartManager object
– SPWebPartConnection object
– WebPartZone object
– WebPartPage object
– ToolPane object
– ToolPart object
Source: http://msdn.microsoft.com/en-us/library/ff872402.aspx
14. SharePoint Features / Solutions
Solution (.wsp)
Feature 2 Feature 1
Event Web Web
… CSS … JS
Handler Part Part
15. Developer Tools
• Visual Studio 2010 SharePoint Power Tools
– adds Visual Web Part
– SandBoxed solution validation (must have!)
• Office365 Sandbox FxCop rules
• CKSDEV add-on
– Trusted proxy
– Deployment options
• Other stuff:
– Visual Studio 2010 Productivity Pack
– SP Dispose Checker (how to integrate with VS)
25. Monitored Resources
Resources Hard
Metric Name Description Units
Per Point Limit
AbnormalProcessTerminationCount Process gets abnormally terminated Count 1 1
CPUExecutionTime CPU exception time Seconds 3,600 60
CriticalExceptionCount Critical exception fired Number 10 3
Number of times solution
InvocationCount Count N/A N/A
has been invoked
Percentage Units of Overall
PercentProcessorTime Note: # of cores not factored in 85 100
Processor Consumed
ProcessCPUCycles CPU Cycles 1E+11 1E+11
ProcessHandleCount Windows Handles 10,000 1,000
(Hard Limit Only) Bytes written
ProcessIOBytes Bytes 0 1E+08
to IO
Number of Threads
ProcessThreadCount Threads 10,000 200
in Overall Process
(Hard Limit Only)
ProcessVirtualBytes Bytes 0 1E+09
Memory consumed
SharePointDatabaseQueryCount SharePoint DB Queries Invoked Number 20 100
Amount of time spent waiting
SharePointDatabaseQueryTime Seconds 120 60
for a query to be performed
UnhandledExceptionCount Unhanded Exceptions 50 3
We have to kill the process because
UnresponsiveprocessCount Number 2 1
it has become unresponsive
Resource Per Point is how much this contributes to the point limit per day for the site collectionHard Limit is how much of this resource a solution can use in a single invocation before it is terminated – a maximum use of quota in a single invocationInvocation count is used to measure the per-instance cost of a solution for purposes of reporting and assigning to run-time “tiers” for farms that want to separate solutions into multiple different sandbox processes – there is only one by default.