Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Best practices with SharePoint 2010 sandboxed solutions

on

  • 4,944 views

...


SharePoint 2010 sandboxed solutions changed the way how we can develop applications on top of SharePoint platform. This session will talk about sandboxed solutions architecture, do's and don'ts, types of solutions that should be built as sandboxed solutions. 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.

Statistics

Views

Total Views
4,944
Views on SlideShare
4,543
Embed Views
401

Actions

Likes
1
Downloads
85
Comments
0

3 Embeds 401

http://www.sharepointusecases.com 399
http://66.240.245.131 1
http://www.slideshare.net 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • HUOJ
  • 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.
  • Source: http://blah.winsmarts.com/2009-12-SharePoint_2010_Sandboxed_Solutions__Full_Trust__Proxies.aspx

Best practices with SharePoint 2010 sandboxed solutions Best practices with SharePoint 2010 sandboxed solutions Presentation Transcript

  • Best practices with SharePoint 2010 Sandboxed Solutions
    Toni FrankolaSharePoint Services MVP, Croatia
    http://www.sharepointusecases.com
    Toni.frankola@acceleratio.hr
    @ToniFrankola
  • About speaker…
  • Agenda
    Intro to SharePoint SandBoxed solutions
    SandBoxed solutions for DEVs
    SandBoxed solutions for IT PROs
    Demo
  • The problem in v2007 (1)
    Casestudy:
    A Customer wants to use WSS 3.0 for group collaboration in hosting environment…
    …withCustom permissions, views, web-parts
    Your only option for hosted WSS 3.0:
    SP Designer 2007 + Javascript (JQuery)
  • The problem in v2007 (2)
    In non-hosted environments:
    Using GAC or Full-trust for everything
    One webpart could jeopardize entire farm
    „Performance Issues” with entire farm
  • The solution
  • SandBoxed Solutions
    Isolated SP process (User Code Service)
    Exposes a subset of Microsoft.SharePoint namespace
    Managed via Site Coll. Solutions gallery
  • Hello WORLD FROM Sandboxed solution
    DEMO
  • SANDBOXED SOLUTIONS - DEV Perspective
  • How stuff works
    FRONT END
    BACK END
    Host Services (SPUCHostService.exe)
    Execution Manager(Inside Application Pool)
    Worker Service
    (SPUCWorkerProcess.exe)
    IIS(WPW3.EXE)
    Untrusted Code
    Subset Object Model
    Subset-Model Request
    Full Object Model
    Full-ModelRequest
  • 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
  • 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
  • BP1 – Proper Tools
    Visual Studio 2010 SharePoint Power Tools
    adds Visual Web Part
    SandBoxed solution validation (must have!)
    CKSDEV add-on
    Trusted proxy
    Deployment options
    Other must havestuff:
    Visual Studio 2010 Productivity Pack
    SP Dispose Checker (how to integratewith VS)
  • BP2 – VS2010 deployment configurations
    Generate SandBoxed/Farm solutions from same code base (blog post):
  • BP 3 – How to detect if SandBoxed?
    No OOTB, but:
    AppDomain.CurrentDomain.FriendlyName.Contains("Sandbox")
  • BP4 – „Sandboxed is default”
    When developing:
    Use Sandboxed whenever possible
    Faster deployment (no Recycling required)
    Separate farm/sandboxed solutions
  • BP5 – Use it for „Small fixes”
    Auto apply theme
    Auto apply language settings
    JQuery loader
    UI adjustments (e.g. hide or addsomething)
  • Sandboxed vs. JQuery copy/paste
    Version control (e.g. via VSTS)
    SharePoint FeatureVersions
    Easy to deploy to different environments
    Can be deployed to site coll. level
  • Not supported
    Off-box connections, http, web services, etc
    ADO.net
    Enterprise features (Search, BCS, etc.)
    Threading
    P-Invoke
    IO
    Other sites (site collections)
  • SANDBOXED SOLUTIONS - ITPRO Perspective
  • Verybad WebPart
    Infinite loop example:
    Farm solution = problem
    Sandboxed solution:
  • Monitoring 101
    Site Collection Admin
    Farm admin
  • Monitored Resources
  • BP6 – Resourceusage
    Resource: SharePointDatabaseQueryCount
    Number of SharePoint DB Queries Invoked
    20 = 1 point
    Default day limit 300 points
    Best practice: Adjust the limits to the env.
  • Benefits for ITPROs
    Stability of SharePoint farm cannot be jeopardized
    You can control which web parts will allowed
    Less administration required
    Empowering Site Coll. owners
  • BP7 – for IT PROs
    Do not enable if not necessary
    Configure permissions
    In hosting env. (from business perspective):
    Gain competitive advantage:
  • BEYOND SANDBOX
  • Sandboxed solution limitations
    3rd party .NET components do not work well with Sandboxed Solutions
    Solutions: Revert back to JQuery
    JQuery charts (licensing!):
  • BP8.1 – Extending Sandbox
    Trusted proxies:
    Worker Service
    (SPUCWorkerProcess.exe)
    GAC
    Untrusted Code
    SPProxyOperationArgs
    SPProxyOperationArgs
    SPUtility
    SPProxyOperation
    SecuredResource
  • BP8.1– Extending Sandbox (2)
    Codesample:
    publicclassFileProxy : SPProxyOperation{
    publicoverrideobject Execute(SPProxyOperationArgsargs){
    if(args != null){
    FileArgsfileArgs = argsasFileArgs;
    FileStreamfStream = newFileStream(@"C:PathSampleFile.txt", FileMode.CreateNew);
    fStream.Write(System.Text.ASCIIEncoding.ASCII.GetBytes(fileArgs.FileContents), 0, fileArgs.FileContents.Length);
    fStream.Flush();
    fStream.Close();
    returnfileArgs.FileContents;
    }
    elsereturnnull;
    }
    }
    Source: http://blah.winsmarts.com/2009-12-SharePoint_2010_Sandboxed_Solutions__Full_Trust__Proxies.aspx
  • BP8.2– Extending Sandbox
    Using SharePoint Client API:
    Worker Service
    (SPUCWorkerProcess.exe)
    Silverlight App
    Silverlight Web Part Host
    Uncustomized Page
    JavaScript
    Web Service (or Client OM)
    SecuredResource
    http://spservices.codeplex.com
    OrSPServicesopen-source
  • Samples
    Source: www.sharepointaccelerators.com
    Source: www.21scrum.com
  • SandBoxed solutioncasestudy
    Contacts
    Email
    Inbox
    Issues
    Confirmation Email
  • Sandboxed solutionexample
    DEMO
  • Conclusion
    Use whenever possible…
    …But know the limits!
    Happy programming!
  • QUESTIONS?
  • THANK YOU!
    Toni FrankolaSharePoint Services MVP, Croatia
    http://www.sharepointusecases.com
    Toni.frankola@acceleratio.hr
    @ToniFrankola