SharePoint aims at reducing the involvement of IT team in the solution lifecycle. Deployment and monitoring of custom solutions is one area where Farm administrators (IT team) are still putting a significant amount of effort. This effort can be reduced (I would use the word REDUCED effort instead of no effort because of the concept of Solution Validation) if the business needs can be fulfilled by Sandboxed solution.
In this series of blogs, I’ll be covering following topics:
- Overview of Sanboxed Solution
- Architecture and Execution Model of Sandboxed Solution
- Sandbox Proxy
- Solution Validation
Overview of Sandboxed Solution
If I try to define sandboxed solution technically then the easiest way is — It runs under context of SPUCWorkerProcess (instead of w3wp) which has limited access to the resources.Before you decide on Sandboxed solution for your application, you need to be aware of the following:
- It has access to only a subset of SharePoint object model. So limited operations can be performed
- It has no access to file system. So you cannot create Visual Web Parts or read/ write web.config file or log exceptions into log files
- No support to external web services
- No Email support using SPUtility.SendMail
- Impersonation is not allowed. So you cannot use SPSecurity.RunWithElevatedPrivileges
- Scope of the solution is limited. You can access only site collection level resources in which it is deployed
- Performance is another concern. If sand box worker process runs for more than 30 seconds then the UserCodeHosting service terminates the process
Don’t worry there are ways to perform full trust operation even after these restriction. I’ll show it in further blogs (3. Sandbox Proxy).
Now we are aware of, on a high level, what we can’t do. Let’s see what we can do. We can create:
- Web Parts (normal, not visual web part)
- Lists
- List Templates
- Custom Actions
- Event Receivers
- Content Types
- Site Columns
- Workflows
- Event Receivers
- And many more…
- Deployment – The Site Collection Administrator (SCA) gets a solution as swp file and uploads it into Solution Gallery. Once it is uploaded she needs to activate it. On activation the solution is validated against validation logic (either OOB or custom). IIS reset/Web App pool recycling required. Great huh?
- Activation - If the validation is passed then the solution is activated which activates all the features contained in the solution. The SCA doesn’t need to activate the features separately (but cross checking is always good :P). If we assume that a feature contains a web part then on activation the web part would be populated into web part gallery.
- Deactivation – On deactivation the solution, the web part no longer executes but still be present in the web part gallery.
- Deletion – The solution is deleted. The web part, obviously, doesn’t executes but still it remains in the web part gallery.
Nice, looking forward to seeing these new posts especially with the scenario you’re building for SharePoint 2013 blogs!
ReplyDeleteSharePoint 2013 Videos