SharePoint 2010 Sandboxed Solution

1,991 views

Published on

Published in: Technology
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total views
1,991
On SlideShare
0
From Embeds
0
Number of Embeds
24
Actions
Shares
0
Downloads
0
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide
  • Greeting
  • SharePoint 2010 Sandboxed Solution

    1. 1. SharePoint 2010 Sandboxed Solutions Created 08/8/2009 Srini Sistla
    2. 2. About me ©COMSYS. ALL RIGHTS RESERVED Srini Sistla Sr. SharePoint Consultant / SME / MCTS / Speaker / Trainer [email_address]
    3. 3. Knowing the audience <ul><li>How many of you are developers? </li></ul><ul><li>How many of you are administrators? </li></ul><ul><li>All others </li></ul><ul><li>How many of you have already seen SPS 2010? </li></ul><ul><li>How many of you have hands on SPS 2010? </li></ul>©COMSYS. ALL RIGHTS RESERVED
    4. 4. Agenda <ul><li>Existing Challenges </li></ul><ul><li>Sandboxed Solutions </li></ul><ul><li>Demo(s) </li></ul><ul><li>Monitor </li></ul><ul><li>Validate </li></ul>©COMSYS. ALL RIGHTS RESERVED
    5. 5. Existing Challenges ( Developers ) <ul><li>Deployment Limitations wrt permissions </li></ul><ul><li>What if you have post deployment changes? </li></ul><ul><li>Monitoring </li></ul><ul><li>Performance </li></ul><ul><li>Farm / Server Outages </li></ul>©COMSYS. ALL RIGHTS RESERVED
    6. 6. Existing Challenges ( Administrators ) <ul><li>Cant view the code; is it trusted? </li></ul><ul><li>Re-deployment on changes </li></ul><ul><li>Memory leaks / Undisposed Objects </li></ul><ul><li>Resource Consumption </li></ul><ul><li>Performance </li></ul><ul><li>Farm / Server Outages </li></ul><ul><li>Server restarts </li></ul>©COMSYS. ALL RIGHTS RESERVED
    7. 7. Sandboxed Solutions <ul><li>Packages ( . wsp ) that can be Added ( Uploaded ) to Solution Gallery and Deployed ( Activated ) at Site Collection level with Site Collection Administrator rights. </li></ul><ul><li>Allow Partial Trust </li></ul><ul><li>Code executes as in Sandbox </li></ul>©COMSYS. ALL RIGHTS RESERVED
    8. 8. Types of Solutions <ul><li>Farm Solutions </li></ul><ul><li>Runs on W3 WorkerProcess </li></ul><ul><li>Deployed by Farm Admins </li></ul><ul><li>Artifacts are deployed to file system </li></ul><ul><li>Runs under Full Trust </li></ul><ul><li>SandBoxed Solutions </li></ul><ul><li>Runs on SPUCWorkerProcess </li></ul><ul><li>Deployed by Site Collection Admins </li></ul><ul><li>Artifacts are deployed to database </li></ul><ul><li>Runs under partial Trust </li></ul>©COMSYS. ALL RIGHTS RESERVED
    9. 9. Why use SBS? <ul><li>Isolation </li></ul><ul><ul><li>Deployed to the database ( no files within the SBS will touch file system ). </li></ul></ul><ul><ul><li>Runs under special process, SPUCWorkerProcess.exe </li></ul></ul><ul><ul><li>Assign Resource Points </li></ul></ul><ul><ul><li>Doesn’t effect other Site Collections </li></ul></ul><ul><li>No waiting on farm admins to deploy your solutions </li></ul><ul><li>Farm admins don’t need to worry about bad solutions any more </li></ul>©COMSYS. ALL RIGHTS RESERVED
    10. 10. Why use SBS? ( Cont… ) <ul><li>Runs on partial trust ( own CAS policy ) </li></ul><ul><li>Can be monitored </li></ul><ul><li>Can be validated </li></ul><ul><li>Hosting issues in corporates are solved </li></ul><ul><li>Easy to manage hosted environments </li></ul><ul><li>and Quick TAT </li></ul>©COMSYS. ALL RIGHTS RESERVED
    11. 11. Stages ©COMSYS. ALL RIGHTS RESERVED
    12. 12. When Should you use SBS? and Elements <ul><li>“ By default its preferred to use SBS solutions always” </li></ul><ul><li>We can create the following using SBS </li></ul><ul><li>Web Parts ( System.Web.UI.WebControls.Webparts.WebPart ) </li></ul><ul><li>List ( Definitions & Instances ) </li></ul><ul><li>Custom Actions </li></ul><ul><li>Event Receivers ( on items, list and webs ) </li></ul><ul><li>Content Types/Fields </li></ul><ul><li>Module/files </li></ul><ul><li>Feature callouts </li></ul><ul><li>Workflows </li></ul><ul><li>… </li></ul>©COMSYS. ALL RIGHTS RESERVED
    13. 13. Introducing my VM <ul><li>4096 MB / Dual Core / 60GB HDD </li></ul><ul><li>Windows Server 2008 Standard Edition </li></ul><ul><li>SharePoint Server 2010 Beta 2 </li></ul><ul><li>Visual Studio 2010 Beta 2 </li></ul><ul><li>SQL Server 2008 </li></ul><ul><li>Office Professional Edition 2010 Beta </li></ul>©COMSYS. ALL RIGHTS RESERVED
    14. 14. <ul><li>DEMO # 1 </li></ul><ul><li>Setup your environment, Creating a SBS, Deploy, Debug </li></ul>©COMSYS. ALL RIGHTS RESERVED
    15. 15. Setup your environment <ul><li>Activate User Code Service </li></ul><ul><li>Configure quotas and locks </li></ul><ul><li>Add ACL Access Rules using PowerShell on a Domain Controller </li></ul>©COMSYS. ALL RIGHTS RESERVED
    16. 16. Sandboxed Solutions Process ©COMSYS. ALL RIGHTS RESERVED Solution gallery Web Part gallery Root SPWeb of SPSite WebParts.wsp Per-WFE AssemblyCache Sandboxed Code Service
    17. 17. Execution Details ©COMSYS. ALL RIGHTS RESERVED Front End Execution Manager Back End Host Service Worker Process Full Object Model Untrusted Code Subset of Object Model
    18. 18. Following cannot be created using SBS <ul><li>Cannot use SPSecurity et all classes </li></ul><ul><li>Web Application and Farm scoped Features </li></ul><ul><li>Layouts Folders in the solution </li></ul><ul><li>Sending Emails (SPUtility.SendEmail) </li></ul><ul><li>Custom Action Groups </li></ul><ul><li>HideCustomAction element </li></ul><ul><li>Content Type Binding </li></ul><ul><li>Timer Jobs </li></ul><ul><li>… </li></ul>©COMSYS. ALL RIGHTS RESERVED
    19. 19. <ul><li>DEMO # 2 </li></ul><ul><li>What you can’t do </li></ul>©COMSYS. ALL RIGHTS RESERVED
    20. 20. Solution Restrictions ©COMSYS. ALL RIGHTS RESERVED CA > System Settings > Farm Management > Manage User Solutions
    21. 21. <ul><li>DEMO # 3 </li></ul><ul><li>Restrict a Solution </li></ul>©COMSYS. ALL RIGHTS RESERVED
    22. 22. Monitoring <ul><li>Site collection quotas specify the warning and hard limits for number of resources that can be used per day </li></ul><ul><li>Sum of resource measures are taken across solutions deployed to site collection </li></ul><ul><ul><li>i.e.: add up CPU Points for all solutions </li></ul></ul><ul><li>Max of resource utilization measures checked against site collection quota to determine if it should be throttled/blocked </li></ul>©COMSYS. ALL RIGHTS RESERVED
    23. 23. Monitored Resources ©COMSYS. ALL RIGHTS RESERVED
    24. 24. Monitoring > Quotas ©COMSYS. ALL RIGHTS RESERVED CA > Application Management > Site Collections > Configure quotas
    25. 25. Validations <ul><li>Validate based on the requirements </li></ul><ul><li>Restrict if needed </li></ul><ul><li>Runs at Farm Level </li></ul><ul><li>Validate solutions when installed or changed </li></ul><ul><li>SP Solution Validator Template @ </li></ul><ul><li>http://spsolutionvalidator.codeplex.com </li></ul>©COMSYS. ALL RIGHTS RESERVED
    26. 26. <ul><li>DEMO # 4 </li></ul><ul><li>Solution Validator </li></ul>©COMSYS. ALL RIGHTS RESERVED
    27. 27. <ul><li>References </li></ul>©COMSYS. ALL RIGHTS RESERVED
    28. 28. References > Sahil Malik Sahil is a Microsoft techie. Sahil has been a Microsoft MVP, INETA Speaker, a .NET author, consultant and trainer for the past many years. You can find him in a regular SharePoint column in code-magazine. Sahil’s Next Book (Available April 2010)
    29. 29. References > Websites / Video’s <ul><li>http://msdn.microsoft.com/en-us/magazine/ee335711.aspx </li></ul><ul><li>http://channel9.msdn.com/learn/courses/SharePoint2010Developer/SandboxedSolutions/ </li></ul><ul><li>( Videos by Andrew Connell ) </li></ul><ul><li>http://blogs.msdn.com/pandrew/ </li></ul><ul><li>( Videos and blog by Paul Andrew ) </li></ul>©COMSYS. ALL RIGHTS RESERVED
    30. 30. Questions and Contact ©COMSYS. ALL RIGHTS RESERVED

    ×