SlideShare una empresa de Scribd logo
1 de 37
Best practices with SharePoint
2010 Sandboxed Solutions
Toni Frankola
SharePoint 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)
• Case study:
– A Customer wants to use WSS 3.0 for group
collaboration in hosting environment…
– …with Custom 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
Worker Service
(SPUCWorkerProcess.exe)
Host Services
(SPUCHostService.exe)
Execution Manager
(Inside Application Pool)
IIS
(WPW3.EXE)
FRONT END BACK END
Subset-Model
RequestFull-Model
Request
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 have stuff:
– Visual Studio 2010 Productivity Pack
– SP Dispose Checker (how to integrate with 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 add something)
Sandboxed vs. JQuery copy/paste
• Version control (e.g. via VSTS)
• SharePoint Feature Versions
• 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
Very bad WebPart
• Infinite loop example:
• Farm solution = problem
• Sandboxed solution:
Monitoring 101
• Site Collection Admin
• Farm admin
Monitored Resources
Metric Name Description Units
Resources
Per Point
Hard
Limit
AbnormalProcessTerminationCount Process gets abnormally terminated Count 1 1
CPUExecutionTime CPU exception time Seconds 3,600 60
CriticalExceptionCount Critical exception fired Number 10 3
InvocationCount
Number of times solution
has been invoked
Count N/A N/A
PercentProcessorTime Note: # of cores not factored in
Percentage Units of Overall
Processor Consumed
85 100
ProcessCPUCycles CPU Cycles 1E+11 1E+11
ProcessHandleCount Windows Handles 10,000 1,000
ProcessIOBytes
(Hard Limit Only) Bytes written
to IO
Bytes 0 1E+08
ProcessThreadCount
Number of Threads
in Overall Process
Threads 10,000 200
ProcessVirtualBytes
(Hard Limit Only)
Memory consumed
Bytes 0 1E+09
SharePointDatabaseQueryCount SharePoint DB Queries Invoked Number 20 100
SharePointDatabaseQueryTime
Amount of time spent waiting
for a query to be performed
Seconds 120 60
UnhandledExceptionCount Unhanded Exceptions 50 3
UnresponsiveprocessCount
We have to kill the process because
it has become unresponsive
Number 2 1
BP6 – Resource usage
• 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:
SPUCWorkerProcess.exe
BP8.1 – Extending Sandbox (2)
• Code sample:
public class FileProxy : SPProxyOperation {
public override object Execute(SPProxyOperationArgs args) {
if (args != null) {
FileArgs fileArgs = args as FileArgs;
FileStream fStream = new FileStream(@"C:PathSampleFile.txt",
FileMode.CreateNew);
fStream.Write(System.Text.ASCIIEncoding.ASCII.GetBytes(fileArgs.FileContents),
0, fileArgs.FileContents.Length);
fStream.Flush();
fStream.Close();
return fileArgs.FileContents;
}
else return null;
}
}
Source: http://blah.winsmarts.com/2009-12-SharePoint_2010_Sandboxed_Solutions__Full_Trust__Proxies.aspx
BP8.2 – Extending Sandbox
• Using SharePoint Client API:
SPUCWorkerProcess.exe
http://spservices.codeplex.com
Samples
Source: www.sharepointaccelerators.com
Source: www.21scrum.com
Active Resolved Closed
SandBoxed solution case study
Email Inbox Issues
Contacts
Confirmation Email
SANDBOXED SOLUTION
EXAMPLE
DEMO
Conclusion
• Use whenever possible…
• …But know the limits!
• Happy programming!
QUESTIONS?
THANK YOU!
Toni Frankola
SharePoint Services MVP, Croatia
http://www.sharepointusecases.com
Toni.frankola@acceleratio.hr
@ToniFrankola

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

SharePoint 2010 Development for ASP.NET Developers - Tyson Devcon 2010
SharePoint 2010 Development for ASP.NET Developers - Tyson Devcon 2010SharePoint 2010 Development for ASP.NET Developers - Tyson Devcon 2010
SharePoint 2010 Development for ASP.NET Developers - Tyson Devcon 2010
 
Team foundation server
Team foundation serverTeam foundation server
Team foundation server
 
Deployment - Done Right!
Deployment - Done Right!Deployment - Done Right!
Deployment - Done Right!
 
Flask
FlaskFlask
Flask
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
Software Architecture for Innovation
Software Architecture for InnovationSoftware Architecture for Innovation
Software Architecture for Innovation
 
Microservices, DevOps, Continuous Delivery – More Than Three Buzzwords
Microservices, DevOps, Continuous Delivery – More Than Three BuzzwordsMicroservices, DevOps, Continuous Delivery – More Than Three Buzzwords
Microservices, DevOps, Continuous Delivery – More Than Three Buzzwords
 
Infrastructure for Continuous Delivery & Microservices: PaaS or Docker?
Infrastructure for Continuous Delivery & Microservices: PaaS or Docker?Infrastructure for Continuous Delivery & Microservices: PaaS or Docker?
Infrastructure for Continuous Delivery & Microservices: PaaS or Docker?
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6
 
Realtime with websockets
Realtime with websocketsRealtime with websockets
Realtime with websockets
 
Clustering Multiple Instances in Cold Fusion
Clustering Multiple Instances in Cold FusionClustering Multiple Instances in Cold Fusion
Clustering Multiple Instances in Cold Fusion
 
RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016
 
MWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVCMWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVC
 
IIS7 For Non IIS PFEs
IIS7 For Non IIS PFEsIIS7 For Non IIS PFEs
IIS7 For Non IIS PFEs
 
SSO 5.1 start-up issues
SSO 5.1 start-up issuesSSO 5.1 start-up issues
SSO 5.1 start-up issues
 
Ad108 - XPages in the IBM Lotus Notes Client - A Deep Dive!
Ad108 - XPages in the IBM Lotus Notes Client - A Deep Dive!Ad108 - XPages in the IBM Lotus Notes Client - A Deep Dive!
Ad108 - XPages in the IBM Lotus Notes Client - A Deep Dive!
 
Surviving the Azure Avalanche
Surviving the Azure AvalancheSurviving the Azure Avalanche
Surviving the Azure Avalanche
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
Application Virtualization Smackdown
Application Virtualization SmackdownApplication Virtualization Smackdown
Application Virtualization Smackdown
 
How Evoq Helps You Build Modern Web Applications
How Evoq Helps You Build Modern Web ApplicationsHow Evoq Helps You Build Modern Web Applications
How Evoq Helps You Build Modern Web Applications
 

Similar a Best practices with SharePoint 2010 sandboxed solutions

SharePoint Palooza 2010 - Allyis showcase
SharePoint Palooza 2010 - Allyis showcaseSharePoint Palooza 2010 - Allyis showcase
SharePoint Palooza 2010 - Allyis showcase
Allyis
 
Developing for SharePoint Online
Developing for SharePoint OnlineDeveloping for SharePoint Online
Developing for SharePoint Online
Ari Bakker
 
Custom Development for SharePoint
Custom Development for SharePointCustom Development for SharePoint
Custom Development for SharePoint
Talbott Crowell
 
SharePoint Sandboxed Solutions and InfoPath - TechEd Middle East
SharePoint Sandboxed Solutions and InfoPath - TechEd Middle EastSharePoint Sandboxed Solutions and InfoPath - TechEd Middle East
SharePoint Sandboxed Solutions and InfoPath - TechEd Middle East
Ayman El-Hattab
 
SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!
Ben Steinhauser
 

Similar a Best practices with SharePoint 2010 sandboxed solutions (20)

Mostafa Elzoghbi: SharePoint 2010 Sanbbox Solutions bestpractices - public
Mostafa Elzoghbi: SharePoint 2010 Sanbbox Solutions bestpractices - publicMostafa Elzoghbi: SharePoint 2010 Sanbbox Solutions bestpractices - public
Mostafa Elzoghbi: SharePoint 2010 Sanbbox Solutions bestpractices - public
 
Architecting Windows Azure
Architecting Windows AzureArchitecting Windows Azure
Architecting Windows Azure
 
SharePoint Palooza 2010 - Allyis showcase
SharePoint Palooza 2010 - Allyis showcaseSharePoint Palooza 2010 - Allyis showcase
SharePoint Palooza 2010 - Allyis showcase
 
SharePoint Fundamentals (Lesson 1&2)
SharePoint Fundamentals (Lesson 1&2)SharePoint Fundamentals (Lesson 1&2)
SharePoint Fundamentals (Lesson 1&2)
 
Developing for SharePoint Online
Developing for SharePoint OnlineDeveloping for SharePoint Online
Developing for SharePoint Online
 
Playing in the Sandbox by Wictor Wilén
Playing in the Sandbox by Wictor WilénPlaying in the Sandbox by Wictor Wilén
Playing in the Sandbox by Wictor Wilén
 
Custom Development for SharePoint
Custom Development for SharePointCustom Development for SharePoint
Custom Development for SharePoint
 
SharePoint Sandboxed Solutions and InfoPath - TechEd Middle East
SharePoint Sandboxed Solutions and InfoPath - TechEd Middle EastSharePoint Sandboxed Solutions and InfoPath - TechEd Middle East
SharePoint Sandboxed Solutions and InfoPath - TechEd Middle East
 
Session 2 Integrating SharePoint 2010 and Windows Azure
Session 2   Integrating SharePoint 2010 and Windows AzureSession 2   Integrating SharePoint 2010 and Windows Azure
Session 2 Integrating SharePoint 2010 and Windows Azure
 
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUSBest Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
 
Share Point
Share PointShare Point
Share Point
 
Getting started with Office 365 SharePoint 2010 online development
Getting started with Office 365 SharePoint 2010 online developmentGetting started with Office 365 SharePoint 2010 online development
Getting started with Office 365 SharePoint 2010 online development
 
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint Beast2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
 
SharePoint Design & Development
SharePoint Design & DevelopmentSharePoint Design & Development
SharePoint Design & Development
 
SharePoint Development (Lesson 3)
SharePoint Development (Lesson 3)SharePoint Development (Lesson 3)
SharePoint Development (Lesson 3)
 
SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!
 
Case Study: A Complex SharePoint Migration
Case Study: A Complex SharePoint MigrationCase Study: A Complex SharePoint Migration
Case Study: A Complex SharePoint Migration
 
Datapolis Guest Expert Presentation: Top 15 SharePoint Server Configuration M...
Datapolis Guest Expert Presentation: Top 15 SharePoint Server Configuration M...Datapolis Guest Expert Presentation: Top 15 SharePoint Server Configuration M...
Datapolis Guest Expert Presentation: Top 15 SharePoint Server Configuration M...
 
COB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersCOB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developers
 
Where to save my data, for devs!
Where to save my data, for devs!Where to save my data, for devs!
Where to save my data, for devs!
 

Más de Toni Frankola

Share point 2010 installation and mainteinance, best practices
Share point 2010   installation and mainteinance, best practices Share point 2010   installation and mainteinance, best practices
Share point 2010 installation and mainteinance, best practices
Toni Frankola
 
SharePoint 2010 – Installation and maintenance – best practices
SharePoint 2010 – Installation and maintenance – best practicesSharePoint 2010 – Installation and maintenance – best practices
SharePoint 2010 – Installation and maintenance – best practices
Toni Frankola
 
Automating SharePoint 2010 administration tasks with PowerShell
Automating SharePoint 2010 administration tasks with PowerShellAutomating SharePoint 2010 administration tasks with PowerShell
Automating SharePoint 2010 administration tasks with PowerShell
Toni Frankola
 
Windays 2011 - SharePoint no-code solutions with InfoPath 2010 and SharePoint...
Windays 2011 - SharePoint no-code solutions with InfoPath 2010 and SharePoint...Windays 2011 - SharePoint no-code solutions with InfoPath 2010 and SharePoint...
Windays 2011 - SharePoint no-code solutions with InfoPath 2010 and SharePoint...
Toni Frankola
 
Building SharePoint 2010 applications with InfoPath 2010 and SharePoint Desig...
Building SharePoint 2010 applications with InfoPath 2010 and SharePoint Desig...Building SharePoint 2010 applications with InfoPath 2010 and SharePoint Desig...
Building SharePoint 2010 applications with InfoPath 2010 and SharePoint Desig...
Toni Frankola
 
The wonderful world of SharePoint 2010 service apps
The wonderful world of SharePoint 2010 service appsThe wonderful world of SharePoint 2010 service apps
The wonderful world of SharePoint 2010 service apps
Toni Frankola
 
Playing in the SharePoint SandBox
Playing in the SharePoint SandBoxPlaying in the SharePoint SandBox
Playing in the SharePoint SandBox
Toni Frankola
 

Más de Toni Frankola (16)

Understanding and Tracking Office 365 Usage and Adoption
Understanding and Tracking Office 365 Usage and AdoptionUnderstanding and Tracking Office 365 Usage and Adoption
Understanding and Tracking Office 365 Usage and Adoption
 
Governance in the Modern Workplace: SharePoint, OneDrive, Groups, Teams, Flow...
Governance in the Modern Workplace: SharePoint, OneDrive, Groups, Teams, Flow...Governance in the Modern Workplace: SharePoint, OneDrive, Groups, Teams, Flow...
Governance in the Modern Workplace: SharePoint, OneDrive, Groups, Teams, Flow...
 
Prepare for SharePoint 2016 - IT Pro best practices for managing your SharePo...
Prepare for SharePoint 2016 - IT Pro best practices for managing your SharePo...Prepare for SharePoint 2016 - IT Pro best practices for managing your SharePo...
Prepare for SharePoint 2016 - IT Pro best practices for managing your SharePo...
 
SharePoint Governance: stories, myths, legends and real life
SharePoint Governance: stories, myths, legends and real lifeSharePoint Governance: stories, myths, legends and real life
SharePoint Governance: stories, myths, legends and real life
 
Share point 2010 installation and mainteinance, best practices
Share point 2010   installation and mainteinance, best practices Share point 2010   installation and mainteinance, best practices
Share point 2010 installation and mainteinance, best practices
 
SharePoint 2010 – Installation and maintenance – best practices
SharePoint 2010 – Installation and maintenance – best practicesSharePoint 2010 – Installation and maintenance – best practices
SharePoint 2010 – Installation and maintenance – best practices
 
Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2
Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2
Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2
 
Automating SharePoint 2010 administration tasks with PowerShell
Automating SharePoint 2010 administration tasks with PowerShellAutomating SharePoint 2010 administration tasks with PowerShell
Automating SharePoint 2010 administration tasks with PowerShell
 
Windays 2011 - SharePoint no-code solutions with InfoPath 2010 and SharePoint...
Windays 2011 - SharePoint no-code solutions with InfoPath 2010 and SharePoint...Windays 2011 - SharePoint no-code solutions with InfoPath 2010 and SharePoint...
Windays 2011 - SharePoint no-code solutions with InfoPath 2010 and SharePoint...
 
Building SharePoint 2010 applications with InfoPath 2010 and SharePoint Desig...
Building SharePoint 2010 applications with InfoPath 2010 and SharePoint Desig...Building SharePoint 2010 applications with InfoPath 2010 and SharePoint Desig...
Building SharePoint 2010 applications with InfoPath 2010 and SharePoint Desig...
 
The wonderful world of SharePoint 2010 service apps
The wonderful world of SharePoint 2010 service appsThe wonderful world of SharePoint 2010 service apps
The wonderful world of SharePoint 2010 service apps
 
Playing in the SharePoint SandBox
Playing in the SharePoint SandBoxPlaying in the SharePoint SandBox
Playing in the SharePoint SandBox
 
Slovenian SharePoint Conference 2009 - Best Practices To Boost Your Share Poi...
Slovenian SharePoint Conference 2009 - Best Practices To Boost Your Share Poi...Slovenian SharePoint Conference 2009 - Best Practices To Boost Your Share Poi...
Slovenian SharePoint Conference 2009 - Best Practices To Boost Your Share Poi...
 
WinDays 2009 - SharePoint za krajnje korisnike - Prečacima do uspjeha
WinDays 2009 - SharePoint za krajnje korisnike - Prečacima do uspjehaWinDays 2009 - SharePoint za krajnje korisnike - Prečacima do uspjeha
WinDays 2009 - SharePoint za krajnje korisnike - Prečacima do uspjeha
 
WinDays 2009 - SharePoint For End Users - Shortcuts To Success
WinDays 2009 - SharePoint For End Users - Shortcuts To SuccessWinDays 2009 - SharePoint For End Users - Shortcuts To Success
WinDays 2009 - SharePoint For End Users - Shortcuts To Success
 
Introduction To Microsoft Office Share Point 2007 – Planning Installation Con...
Introduction To Microsoft Office Share Point 2007 – Planning Installation Con...Introduction To Microsoft Office Share Point 2007 – Planning Installation Con...
Introduction To Microsoft Office Share Point 2007 – Planning Installation Con...
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Best practices with SharePoint 2010 sandboxed solutions

  • 1. Best practices with SharePoint 2010 Sandboxed Solutions Toni Frankola SharePoint Services MVP, Croatia http://www.sharepointusecases.com Toni.frankola@acceleratio.hr @ToniFrankola
  • 3. Agenda • Intro to SharePoint SandBoxed solutions • SandBoxed solutions for DEVs • SandBoxed solutions for IT PROs • Demo
  • 4. The problem in v2007 (1) • Case study: – A Customer wants to use WSS 3.0 for group collaboration in hosting environment… – …with Custom permissions, views, web-parts • Your only option for hosted WSS 3.0: – SP Designer 2007 + Javascript (JQuery)
  • 5. 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
  • 7. SandBoxed Solutions • Isolated SP process (User Code Service) • Exposes a subset of Microsoft.SharePoint namespace • Managed via Site Coll. Solutions gallery
  • 10. How stuff works Worker Service (SPUCWorkerProcess.exe) Host Services (SPUCHostService.exe) Execution Manager (Inside Application Pool) IIS (WPW3.EXE) FRONT END BACK END Subset-Model RequestFull-Model Request
  • 11. 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
  • 12. 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
  • 13. 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 have stuff: – Visual Studio 2010 Productivity Pack – SP Dispose Checker (how to integrate with VS)
  • 14. BP2 – VS2010 deployment configurations • Generate SandBoxed/Farm solutions from same code base (blog post):
  • 15. BP 3 – How to detect if SandBoxed? • No OOTB, but: AppDomain.CurrentDomain.FriendlyName.Contains("Sandbox")
  • 16. BP4 – „Sandboxed is default” • When developing: – Use Sandboxed whenever possible • Faster deployment (no Recycling required) – Separate farm/sandboxed solutions
  • 17. BP5 – Use it for „Small fixes” • Auto apply theme • Auto apply language settings • JQuery loader • UI adjustments (e.g. hide or add something)
  • 18. Sandboxed vs. JQuery copy/paste • Version control (e.g. via VSTS) • SharePoint Feature Versions • Easy to deploy to different environments • Can be deployed to site coll. level
  • 19. Not supported • Off-box connections, http, web services, etc • ADO.net • Enterprise features (Search, BCS, etc.) • Threading • P-Invoke • IO • Other sites (site collections)
  • 21. Very bad WebPart • Infinite loop example: • Farm solution = problem • Sandboxed solution:
  • 22. Monitoring 101 • Site Collection Admin • Farm admin
  • 23. Monitored Resources Metric Name Description Units Resources Per Point Hard Limit AbnormalProcessTerminationCount Process gets abnormally terminated Count 1 1 CPUExecutionTime CPU exception time Seconds 3,600 60 CriticalExceptionCount Critical exception fired Number 10 3 InvocationCount Number of times solution has been invoked Count N/A N/A PercentProcessorTime Note: # of cores not factored in Percentage Units of Overall Processor Consumed 85 100 ProcessCPUCycles CPU Cycles 1E+11 1E+11 ProcessHandleCount Windows Handles 10,000 1,000 ProcessIOBytes (Hard Limit Only) Bytes written to IO Bytes 0 1E+08 ProcessThreadCount Number of Threads in Overall Process Threads 10,000 200 ProcessVirtualBytes (Hard Limit Only) Memory consumed Bytes 0 1E+09 SharePointDatabaseQueryCount SharePoint DB Queries Invoked Number 20 100 SharePointDatabaseQueryTime Amount of time spent waiting for a query to be performed Seconds 120 60 UnhandledExceptionCount Unhanded Exceptions 50 3 UnresponsiveprocessCount We have to kill the process because it has become unresponsive Number 2 1
  • 24. BP6 – Resource usage • Resource: SharePointDatabaseQueryCount – Number of SharePoint DB Queries Invoked – 20 = 1 point • Default day limit 300 points • Best practice: Adjust the limits to the env.
  • 25. 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
  • 26. BP7 – for IT PROs • Do not enable if not necessary • Configure permissions • In hosting env. (from business perspective): – Gain competitive advantage:
  • 28. Sandboxed solution limitations • 3rd party .NET components do not work well with Sandboxed Solutions – Solutions: Revert back to JQuery – JQuery charts (licensing!):
  • 29. BP8.1 – Extending Sandbox • Trusted proxies: SPUCWorkerProcess.exe
  • 30. BP8.1 – Extending Sandbox (2) • Code sample: public class FileProxy : SPProxyOperation { public override object Execute(SPProxyOperationArgs args) { if (args != null) { FileArgs fileArgs = args as FileArgs; FileStream fStream = new FileStream(@"C:PathSampleFile.txt", FileMode.CreateNew); fStream.Write(System.Text.ASCIIEncoding.ASCII.GetBytes(fileArgs.FileContents), 0, fileArgs.FileContents.Length); fStream.Flush(); fStream.Close(); return fileArgs.FileContents; } else return null; } } Source: http://blah.winsmarts.com/2009-12-SharePoint_2010_Sandboxed_Solutions__Full_Trust__Proxies.aspx
  • 31. BP8.2 – Extending Sandbox • Using SharePoint Client API: SPUCWorkerProcess.exe http://spservices.codeplex.com
  • 33. Active Resolved Closed SandBoxed solution case study Email Inbox Issues Contacts Confirmation Email
  • 35. Conclusion • Use whenever possible… • …But know the limits! • Happy programming!
  • 37. THANK YOU! Toni Frankola SharePoint Services MVP, Croatia http://www.sharepointusecases.com Toni.frankola@acceleratio.hr @ToniFrankola

Notas del editor

  1. HUOJ
  2. Resource Per Point is how much this contributes to the point limit per day for the site collection Hard 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 invocation Invocation 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.
  3. Source: http://blah.winsmarts.com/2009-12-SharePoint_2010_Sandboxed_Solutions__Full_Trust__Proxies.aspx