SlideShare ist ein Scribd-Unternehmen logo
1 von 29
SP 2010 Sandboxed Solutions  MostafaElzoghbi Sr. Software Engineer  - C# MVP MetroStar Systems
Agenda Sandbox Solutions Overview SharePoint 2007 Challenges for Farm Solutions SharePoint 2010 Approach for Sandbox Solutions Sandbox Solutions Lifecycle Executing Code in the Sandbox Sandbox Solutions Limitations Sandbox Resource Monitoring Load balancing Sandbox solutions Solution Validation
Overview of the Sandbox Allows a subset of the full capabilities in the SharePoint API Secure – enforcing the sandbox Execute in a partially trusted environment Code executes in a special service process Subject to CAS Validation framework Provides way to do custom farm wide validation for the deployed packages Each solution is isolated to its site collection
Defining the Sandbox Solution Administration - Quota/Blocked Solutions Subset Object Model External Process Code Access Security (CAS Policies)
SharePoint 2007 Challenge Developers build custom solutions Administrators can only secure solutions with CAS Hard to control what is being done in custom code Biggest cause of SharePoint support cases: custom code
SharePoint 2010 Approach Developers build custom solutions Site collection owners deploy, activate and implement the customizations Administrators leverage resource monitors to check site collection usage Automatic triggers “turn off” custom solutions in a site collection that are too expensive and taxing on the server
Sandboxed Solutions Help Enterprises Sandboxed solutions are important because Hosted environments much easier to manage Reduces time to deploying custom solutions Removing process of getting code approved and deployed by IT (Dev-Staging-Production) Improves stability of SharePoint servers Now badly performing code isolated to site collection rather than potentially bringing down an entire server
Create/Deploy Sandbox solution demo
Site Collection Administration Solution Gallery -- _catalogs/solutions Empower Site Collection administrators
Sandboxed Solution Lifecycle
Managing Sandbox Solutions demo
Solution Administration Central Administration Block Solutions Quota Templates
The Subset Object Model SPSite In general SPSite and below No SPSecurity No SPSite construction Common namespaces not available Microsoft.SharePoint.Administration Microsoft.SharePoint.WebControls SPWeb SPList SPListItem
A Separate Process User Code Service : Started where WFE configured to run sandbox solutions.(SPUCHostService.exe) Sandbox Worker Process: where your actual code runs(SPUCWorkerProcess.exe) Sandbox Worker Process Proxy(SPUCWorkerProcessProxy.exe)
Sandbox and Code Access Security AspNetHostingPermission, Level=Minimal SharePointPermission, ObjectModel=true SecurityPermission, Flags=Execution Sandbox My.dll wss_usercode.config Other.dll System DLL SharePoint DLL Full Trust SharePoint OM Subset OM
Front end Back end Host Service ExecutionManager Sandboxing Architecture Worker Process Untrusted Code Subset Object Model Full Object Model
Sandboxed Solutions Process 2 1 5 6 7 4 3 Per-WFE AssemblyCache RootSPWeb of SPSite <siteguid>ompany.intranet.webpart.wspoo.dll Solution gallery Web Part gallery Sandboxed Worker Process WebParts.wsp
Types of Sandboxed Solutions Sandboxed Solutions Support Sandboxed solutions offer developers a subset of the SharePoint API available fully trusted solutions Site collection and site scoped Features Many XML constructs available: Modules, Lists, ContentTypes, etc. Client technologies to access external data – JavaScript, Silverlight etc. Offloading resource usage and access handling to client
Best Practices: Sandbox Boundaries  Off-box connections, http, web services, etc ADO.net Enterprise features (Search, BCS, etc.) Threading  (No complex processing) P-Invoke IO Other sites x x x x x x x
Compiling vs. Executing Sandboxed Solutions Visual Studio 2010uses IntelliSense tohide full-trust types All code is compiled against the full API Thus, no “sandbox” check at compile time… only at runtime Workaround: change the Microsoft.SharePoint.dll project reference to reference the sandbox’s version [..]4serCodessembliesicrosoft.SharePoint.dll NOTE: Switch it back before deployment! Use this as a temporary test - do not deploy code that references the sandbox’s assembly  This is valid if you don’t have VS 2010 SP Power tools. MyWebPart.dll Runtime Full Object Model Subset Object Model Proxy
Execution vs. Compilation in Sandbox Demo
Load Balancing Sandboxed solutions can be run in two modes Local Mode Execute code on the SharePoint WFE Low administration overhead Lower scalability Remote Mode Execution on back-end farm machine Via dedicated service applications Load balanced distribution of code execution requests
Load balancing Sandbox Solutions & Blocking demo
Solution Validation [GuidAttribute("34805697-1FC4-4b66-AF09-AB48AC0F9D97")] publicclassPublisherValidator:SPSolutionValidator{ publicoverridevoidValidateSolution( SPSolutionValidationProperties properties){ properties.Valid = [true || false]; properties.ValidationErrorMessage = “no soup for you”; } publicoverridevoidValidateAssembly( SPSolutionValidationPropertiesproperties, SPSolutionFileassembly){ } }
Solution Validator demo
Monitored Resources You can tweak these values to fit your need…
Manage Sandbox solution resources demo
Summary Sandbox Solutions Overview SharePoint 2007 Challenges for Farm Solutions SharePoint 2010 Approach for Sandbox Solutions Sandbox Solutions Lifecycle Executing Code in the Sandbox Sandbox Solutions Limitations Sandbox Resource Monitoring Load balancing Sandbox solutions Solution Validation
Blog: http://moustaga-arafa.blogspot.com Twitter: @mostafaelzoghbi

Weitere ähnliche Inhalte

Was ist angesagt?

Deployment - Done Right!
Deployment - Done Right!Deployment - Done Right!
Deployment - Done Right!Eberhard Wolff
 
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 2010Corey Roth
 
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 BuzzwordsEberhard Wolff
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriverSachin-QA
 
Software Architecture for Innovation
Software Architecture for InnovationSoftware Architecture for Innovation
Software Architecture for InnovationEberhard Wolff
 
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?Eberhard Wolff
 
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 6Ido Flatow
 
Clustering Multiple Instances in Cold Fusion
Clustering Multiple Instances in Cold FusionClustering Multiple Instances in Cold Fusion
Clustering Multiple Instances in Cold FusionMindfire Solutions
 
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 2016Ortus Solutions, Corp
 
MWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVCMWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVCUlrich Krause
 
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!ddrschiw
 
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...Mark Leusink
 
SSO 5.1 start-up issues
SSO 5.1 start-up issuesSSO 5.1 start-up issues
SSO 5.1 start-up issuesfbuechsel
 

Was ist angesagt? (20)

Team foundation server
Team foundation serverTeam foundation server
Team foundation server
 
Deployment - Done Right!
Deployment - Done Right!Deployment - Done Right!
Deployment - Done Right!
 
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
 
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
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
Software Architecture for Innovation
Software Architecture for InnovationSoftware Architecture for Innovation
Software Architecture for Innovation
 
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
 
Flask
FlaskFlask
Flask
 
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
 
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!
 
Application Virtualization Smackdown
Application Virtualization SmackdownApplication Virtualization Smackdown
Application Virtualization Smackdown
 
IIS7 For Non IIS PFEs
IIS7 For Non IIS PFEsIIS7 For Non IIS PFEs
IIS7 For Non IIS PFEs
 
Surviving the Azure Avalanche
Surviving the Azure AvalancheSurviving the Azure Avalanche
Surviving the Azure Avalanche
 
Exchange 2010 SP2 & Tips
Exchange 2010 SP2 & TipsExchange 2010 SP2 & Tips
Exchange 2010 SP2 & Tips
 
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...
 
SSO 5.1 start-up issues
SSO 5.1 start-up issuesSSO 5.1 start-up issues
SSO 5.1 start-up issues
 

Ähnlich wie Mostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best Practices

Playing in the SharePoint SandBox
Playing in the SharePoint SandBoxPlaying in the SharePoint SandBox
Playing in the SharePoint SandBoxToni Frankola
 
Diff sand box and farm
Diff sand box and farmDiff sand box and farm
Diff sand box and farmRajkiran Swain
 
SharePoint 2010 Sandboxed Solution
SharePoint 2010 Sandboxed SolutionSharePoint 2010 Sandboxed Solution
SharePoint 2010 Sandboxed SolutionSrini Sistla
 
How to build a cloud adapter
How to build a cloud adapterHow to build a cloud adapter
How to build a cloud adapterMaarten Smeets
 
SharePoint Development For Asp Net Developers
SharePoint Development For Asp Net DevelopersSharePoint Development For Asp Net Developers
SharePoint Development For Asp Net DevelopersCorey Roth
 
Best practices for share point solution deployment
Best practices for share point solution deploymentBest practices for share point solution deployment
Best practices for share point solution deploymentSalaudeen Rajack
 
Developer application lifecycle process and tools - v.5
Developer application lifecycle process and tools - v.5Developer application lifecycle process and tools - v.5
Developer application lifecycle process and tools - v.5Ivan Sanders
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hour
Convert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hourConvert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hour
Convert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hourBrian Culver
 
Best Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsBest Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsAlexander Meijers
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Brian Culver
 
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 EastAyman El-Hattab
 
Getting started with spfx
Getting started with spfxGetting started with spfx
Getting started with spfxJenkins NS
 
Azure DevOps for Developers
Azure DevOps for DevelopersAzure DevOps for Developers
Azure DevOps for DevelopersSarah Dutkiewicz
 
Moss 2007 Wcm Architecture And Development Best Practices In A Team Based E...
Moss 2007 Wcm Architecture And Development   Best Practices In A Team Based E...Moss 2007 Wcm Architecture And Development   Best Practices In A Team Based E...
Moss 2007 Wcm Architecture And Development Best Practices In A Team Based E...Karthik Venkataraman
 
Azure DevOps for JavaScript Developers
Azure DevOps for JavaScript DevelopersAzure DevOps for JavaScript Developers
Azure DevOps for JavaScript DevelopersSarah Dutkiewicz
 
Session 3 - Developer Tools-Sharepoint firestarter-paul yuknewicz
Session 3 - Developer Tools-Sharepoint firestarter-paul yuknewiczSession 3 - Developer Tools-Sharepoint firestarter-paul yuknewicz
Session 3 - Developer Tools-Sharepoint firestarter-paul yuknewiczMithun T. Dhar
 

Ähnlich wie Mostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best Practices (20)

STUG-Sand boxed Solution
STUG-Sand boxed SolutionSTUG-Sand boxed Solution
STUG-Sand boxed Solution
 
Developing Sandbox Solutions
Developing Sandbox SolutionsDeveloping Sandbox Solutions
Developing Sandbox Solutions
 
Playing in the SharePoint SandBox
Playing in the SharePoint SandBoxPlaying in the SharePoint SandBox
Playing in the SharePoint SandBox
 
Diff sand box and farm
Diff sand box and farmDiff sand box and farm
Diff sand box and farm
 
SharePoint 2010 Sandboxed Solution
SharePoint 2010 Sandboxed SolutionSharePoint 2010 Sandboxed Solution
SharePoint 2010 Sandboxed Solution
 
How to build a Oracle cloud adapter SOA, Integration & API's
How to build a Oracle cloud adapter  SOA, Integration & API'sHow to build a Oracle cloud adapter  SOA, Integration & API's
How to build a Oracle cloud adapter SOA, Integration & API's
 
How to build a cloud adapter
How to build a cloud adapterHow to build a cloud adapter
How to build a cloud adapter
 
SharePoint Development For Asp Net Developers
SharePoint Development For Asp Net DevelopersSharePoint Development For Asp Net Developers
SharePoint Development For Asp Net Developers
 
Best practices for share point solution deployment
Best practices for share point solution deploymentBest practices for share point solution deployment
Best practices for share point solution deployment
 
Developer application lifecycle process and tools - v.5
Developer application lifecycle process and tools - v.5Developer application lifecycle process and tools - v.5
Developer application lifecycle process and tools - v.5
 
Introducción al SharePoint Framework SPFx
Introducción al SharePoint Framework SPFxIntroducción al SharePoint Framework SPFx
Introducción al SharePoint Framework SPFx
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hour
Convert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hourConvert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hour
Convert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hour
 
Best Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsBest Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point Solutions
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
 
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
 
Getting started with spfx
Getting started with spfxGetting started with spfx
Getting started with spfx
 
Azure DevOps for Developers
Azure DevOps for DevelopersAzure DevOps for Developers
Azure DevOps for Developers
 
Moss 2007 Wcm Architecture And Development Best Practices In A Team Based E...
Moss 2007 Wcm Architecture And Development   Best Practices In A Team Based E...Moss 2007 Wcm Architecture And Development   Best Practices In A Team Based E...
Moss 2007 Wcm Architecture And Development Best Practices In A Team Based E...
 
Azure DevOps for JavaScript Developers
Azure DevOps for JavaScript DevelopersAzure DevOps for JavaScript Developers
Azure DevOps for JavaScript Developers
 
Session 3 - Developer Tools-Sharepoint firestarter-paul yuknewicz
Session 3 - Developer Tools-Sharepoint firestarter-paul yuknewiczSession 3 - Developer Tools-Sharepoint firestarter-paul yuknewicz
Session 3 - Developer Tools-Sharepoint firestarter-paul yuknewicz
 

Mehr von SharePoint Saturday NY

Sb chatterjee share point workspace 2010 in action
Sb chatterjee   share point workspace 2010 in actionSb chatterjee   share point workspace 2010 in action
Sb chatterjee share point workspace 2010 in actionSharePoint Saturday NY
 
Joel Oleson: SharePoint 2010 Upgrade Drill Down
Joel Oleson: SharePoint 2010 Upgrade Drill DownJoel Oleson: SharePoint 2010 Upgrade Drill Down
Joel Oleson: SharePoint 2010 Upgrade Drill DownSharePoint Saturday NY
 
Peter Ward: The True Power of SharePoint Designer Workflows
Peter Ward: The True Power of SharePoint Designer WorkflowsPeter Ward: The True Power of SharePoint Designer Workflows
Peter Ward: The True Power of SharePoint Designer WorkflowsSharePoint Saturday NY
 
Chris Geier: Information Management in SharePoint 2010
Chris Geier: Information Management in SharePoint 2010Chris Geier: Information Management in SharePoint 2010
Chris Geier: Information Management in SharePoint 2010SharePoint Saturday NY
 
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 - publicSharePoint Saturday NY
 
John Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nyc
John Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nycJohn Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nyc
John Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nycSharePoint Saturday NY
 
John Burkholder: Disaster Recovery in SharePoint 2010
John Burkholder: Disaster Recovery in SharePoint 2010John Burkholder: Disaster Recovery in SharePoint 2010
John Burkholder: Disaster Recovery in SharePoint 2010SharePoint Saturday NY
 
Chris McNulty - Managed Metadata and Taxonomies
Chris McNulty - Managed Metadata and TaxonomiesChris McNulty - Managed Metadata and Taxonomies
Chris McNulty - Managed Metadata and TaxonomiesSharePoint Saturday NY
 
Chris McNulty: ECM/WCM Planning, Implementation and Migration Strategies
Chris McNulty: ECM/WCM Planning, Implementation and Migration StrategiesChris McNulty: ECM/WCM Planning, Implementation and Migration Strategies
Chris McNulty: ECM/WCM Planning, Implementation and Migration StrategiesSharePoint Saturday NY
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...SharePoint Saturday NY
 
Jaime Velez: SharePoint 2010 Social Computing
Jaime Velez: SharePoint 2010 Social ComputingJaime Velez: SharePoint 2010 Social Computing
Jaime Velez: SharePoint 2010 Social ComputingSharePoint Saturday NY
 
Matthew Vignau: Memory Management in SharePoint 2007 Development
Matthew Vignau: Memory Management in SharePoint 2007 DevelopmentMatthew Vignau: Memory Management in SharePoint 2007 Development
Matthew Vignau: Memory Management in SharePoint 2007 DevelopmentSharePoint Saturday NY
 
Geoff Varosky: Creating Custom Actions in SharePoint 2010
Geoff Varosky: Creating Custom Actions in SharePoint 2010Geoff Varosky: Creating Custom Actions in SharePoint 2010
Geoff Varosky: Creating Custom Actions in SharePoint 2010SharePoint Saturday NY
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellSharePoint Saturday NY
 
Kathryn Birstein: SharePoint 2010 Business Intelligence-Bringing it All Together
Kathryn Birstein: SharePoint 2010 Business Intelligence-Bringing it All TogetherKathryn Birstein: SharePoint 2010 Business Intelligence-Bringing it All Together
Kathryn Birstein: SharePoint 2010 Business Intelligence-Bringing it All TogetherSharePoint Saturday NY
 
Susan Lennon: Building SharePoint Dashboards
Susan Lennon: Building SharePoint DashboardsSusan Lennon: Building SharePoint Dashboards
Susan Lennon: Building SharePoint DashboardsSharePoint Saturday NY
 
Scott Lavoie: Best Practices and Pain Points of SharePoint Training
Scott Lavoie: Best Practices and Pain Points of SharePoint TrainingScott Lavoie: Best Practices and Pain Points of SharePoint Training
Scott Lavoie: Best Practices and Pain Points of SharePoint TrainingSharePoint Saturday NY
 
Paul Galvin: Introduction to Infopath and Best Practices
Paul Galvin: Introduction to Infopath and Best PracticesPaul Galvin: Introduction to Infopath and Best Practices
Paul Galvin: Introduction to Infopath and Best PracticesSharePoint Saturday NY
 
Greg Hurlman: Developing Custom Service Applications
Greg Hurlman: Developing Custom Service ApplicationsGreg Hurlman: Developing Custom Service Applications
Greg Hurlman: Developing Custom Service ApplicationsSharePoint Saturday NY
 

Mehr von SharePoint Saturday NY (20)

Sb chatterjee share point workspace 2010 in action
Sb chatterjee   share point workspace 2010 in actionSb chatterjee   share point workspace 2010 in action
Sb chatterjee share point workspace 2010 in action
 
Joel Oleson: SharePoint 2010 Upgrade Drill Down
Joel Oleson: SharePoint 2010 Upgrade Drill DownJoel Oleson: SharePoint 2010 Upgrade Drill Down
Joel Oleson: SharePoint 2010 Upgrade Drill Down
 
Peter Ward: The True Power of SharePoint Designer Workflows
Peter Ward: The True Power of SharePoint Designer WorkflowsPeter Ward: The True Power of SharePoint Designer Workflows
Peter Ward: The True Power of SharePoint Designer Workflows
 
Chris Geier: Information Management in SharePoint 2010
Chris Geier: Information Management in SharePoint 2010Chris Geier: Information Management in SharePoint 2010
Chris Geier: Information Management in SharePoint 2010
 
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
 
John Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nyc
John Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nycJohn Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nyc
John Burkholder: SharePoint 2010 in a multi tenant and hosted environment-nyc
 
John Burkholder: Disaster Recovery in SharePoint 2010
John Burkholder: Disaster Recovery in SharePoint 2010John Burkholder: Disaster Recovery in SharePoint 2010
John Burkholder: Disaster Recovery in SharePoint 2010
 
Chris McNulty - Managed Metadata and Taxonomies
Chris McNulty - Managed Metadata and TaxonomiesChris McNulty - Managed Metadata and Taxonomies
Chris McNulty - Managed Metadata and Taxonomies
 
Chris McNulty: ECM/WCM Planning, Implementation and Migration Strategies
Chris McNulty: ECM/WCM Planning, Implementation and Migration StrategiesChris McNulty: ECM/WCM Planning, Implementation and Migration Strategies
Chris McNulty: ECM/WCM Planning, Implementation and Migration Strategies
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
 
Jaime Velez: SharePoint 2010 Social Computing
Jaime Velez: SharePoint 2010 Social ComputingJaime Velez: SharePoint 2010 Social Computing
Jaime Velez: SharePoint 2010 Social Computing
 
Matthew Vignau: Memory Management in SharePoint 2007 Development
Matthew Vignau: Memory Management in SharePoint 2007 DevelopmentMatthew Vignau: Memory Management in SharePoint 2007 Development
Matthew Vignau: Memory Management in SharePoint 2007 Development
 
Geoff Varosky: Creating Custom Actions in SharePoint 2010
Geoff Varosky: Creating Custom Actions in SharePoint 2010Geoff Varosky: Creating Custom Actions in SharePoint 2010
Geoff Varosky: Creating Custom Actions in SharePoint 2010
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
 
Alphonso Scarborough: SharePoint 101
Alphonso Scarborough: SharePoint 101Alphonso Scarborough: SharePoint 101
Alphonso Scarborough: SharePoint 101
 
Kathryn Birstein: SharePoint 2010 Business Intelligence-Bringing it All Together
Kathryn Birstein: SharePoint 2010 Business Intelligence-Bringing it All TogetherKathryn Birstein: SharePoint 2010 Business Intelligence-Bringing it All Together
Kathryn Birstein: SharePoint 2010 Business Intelligence-Bringing it All Together
 
Susan Lennon: Building SharePoint Dashboards
Susan Lennon: Building SharePoint DashboardsSusan Lennon: Building SharePoint Dashboards
Susan Lennon: Building SharePoint Dashboards
 
Scott Lavoie: Best Practices and Pain Points of SharePoint Training
Scott Lavoie: Best Practices and Pain Points of SharePoint TrainingScott Lavoie: Best Practices and Pain Points of SharePoint Training
Scott Lavoie: Best Practices and Pain Points of SharePoint Training
 
Paul Galvin: Introduction to Infopath and Best Practices
Paul Galvin: Introduction to Infopath and Best PracticesPaul Galvin: Introduction to Infopath and Best Practices
Paul Galvin: Introduction to Infopath and Best Practices
 
Greg Hurlman: Developing Custom Service Applications
Greg Hurlman: Developing Custom Service ApplicationsGreg Hurlman: Developing Custom Service Applications
Greg Hurlman: Developing Custom Service Applications
 

Mostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best Practices

  • 1. SP 2010 Sandboxed Solutions MostafaElzoghbi Sr. Software Engineer - C# MVP MetroStar Systems
  • 2. Agenda Sandbox Solutions Overview SharePoint 2007 Challenges for Farm Solutions SharePoint 2010 Approach for Sandbox Solutions Sandbox Solutions Lifecycle Executing Code in the Sandbox Sandbox Solutions Limitations Sandbox Resource Monitoring Load balancing Sandbox solutions Solution Validation
  • 3. Overview of the Sandbox Allows a subset of the full capabilities in the SharePoint API Secure – enforcing the sandbox Execute in a partially trusted environment Code executes in a special service process Subject to CAS Validation framework Provides way to do custom farm wide validation for the deployed packages Each solution is isolated to its site collection
  • 4. Defining the Sandbox Solution Administration - Quota/Blocked Solutions Subset Object Model External Process Code Access Security (CAS Policies)
  • 5. SharePoint 2007 Challenge Developers build custom solutions Administrators can only secure solutions with CAS Hard to control what is being done in custom code Biggest cause of SharePoint support cases: custom code
  • 6. SharePoint 2010 Approach Developers build custom solutions Site collection owners deploy, activate and implement the customizations Administrators leverage resource monitors to check site collection usage Automatic triggers “turn off” custom solutions in a site collection that are too expensive and taxing on the server
  • 7. Sandboxed Solutions Help Enterprises Sandboxed solutions are important because Hosted environments much easier to manage Reduces time to deploying custom solutions Removing process of getting code approved and deployed by IT (Dev-Staging-Production) Improves stability of SharePoint servers Now badly performing code isolated to site collection rather than potentially bringing down an entire server
  • 9. Site Collection Administration Solution Gallery -- _catalogs/solutions Empower Site Collection administrators
  • 12. Solution Administration Central Administration Block Solutions Quota Templates
  • 13. The Subset Object Model SPSite In general SPSite and below No SPSecurity No SPSite construction Common namespaces not available Microsoft.SharePoint.Administration Microsoft.SharePoint.WebControls SPWeb SPList SPListItem
  • 14. A Separate Process User Code Service : Started where WFE configured to run sandbox solutions.(SPUCHostService.exe) Sandbox Worker Process: where your actual code runs(SPUCWorkerProcess.exe) Sandbox Worker Process Proxy(SPUCWorkerProcessProxy.exe)
  • 15. Sandbox and Code Access Security AspNetHostingPermission, Level=Minimal SharePointPermission, ObjectModel=true SecurityPermission, Flags=Execution Sandbox My.dll wss_usercode.config Other.dll System DLL SharePoint DLL Full Trust SharePoint OM Subset OM
  • 16. Front end Back end Host Service ExecutionManager Sandboxing Architecture Worker Process Untrusted Code Subset Object Model Full Object Model
  • 17. Sandboxed Solutions Process 2 1 5 6 7 4 3 Per-WFE AssemblyCache RootSPWeb of SPSite <siteguid>ompany.intranet.webpart.wspoo.dll Solution gallery Web Part gallery Sandboxed Worker Process WebParts.wsp
  • 18. Types of Sandboxed Solutions Sandboxed Solutions Support Sandboxed solutions offer developers a subset of the SharePoint API available fully trusted solutions Site collection and site scoped Features Many XML constructs available: Modules, Lists, ContentTypes, etc. Client technologies to access external data – JavaScript, Silverlight etc. Offloading resource usage and access handling to client
  • 19. Best Practices: Sandbox Boundaries Off-box connections, http, web services, etc ADO.net Enterprise features (Search, BCS, etc.) Threading  (No complex processing) P-Invoke IO Other sites x x x x x x x
  • 20. Compiling vs. Executing Sandboxed Solutions Visual Studio 2010uses IntelliSense tohide full-trust types All code is compiled against the full API Thus, no “sandbox” check at compile time… only at runtime Workaround: change the Microsoft.SharePoint.dll project reference to reference the sandbox’s version [..]4serCodessembliesicrosoft.SharePoint.dll NOTE: Switch it back before deployment! Use this as a temporary test - do not deploy code that references the sandbox’s assembly  This is valid if you don’t have VS 2010 SP Power tools. MyWebPart.dll Runtime Full Object Model Subset Object Model Proxy
  • 21. Execution vs. Compilation in Sandbox Demo
  • 22. Load Balancing Sandboxed solutions can be run in two modes Local Mode Execute code on the SharePoint WFE Low administration overhead Lower scalability Remote Mode Execution on back-end farm machine Via dedicated service applications Load balanced distribution of code execution requests
  • 23. Load balancing Sandbox Solutions & Blocking demo
  • 24. Solution Validation [GuidAttribute("34805697-1FC4-4b66-AF09-AB48AC0F9D97")] publicclassPublisherValidator:SPSolutionValidator{ publicoverridevoidValidateSolution( SPSolutionValidationProperties properties){ properties.Valid = [true || false]; properties.ValidationErrorMessage = “no soup for you”; } publicoverridevoidValidateAssembly( SPSolutionValidationPropertiesproperties, SPSolutionFileassembly){ } }
  • 26. Monitored Resources You can tweak these values to fit your need…
  • 27. Manage Sandbox solution resources demo
  • 28. Summary Sandbox Solutions Overview SharePoint 2007 Challenges for Farm Solutions SharePoint 2010 Approach for Sandbox Solutions Sandbox Solutions Lifecycle Executing Code in the Sandbox Sandbox Solutions Limitations Sandbox Resource Monitoring Load balancing Sandbox solutions Solution Validation

Hinweis der Redaktion

  1. MostafaElzoghbiMetroStar SystemsSr. Software EngineerMCAD,MCSD,MCTS,C# MVPhttp://moustafa-arafa.blogspot.com
  2. In this demo will show:Use VS 2010 to create sandbox solutions.Deploy and configuration on the Sandbox solutions.Test deploy the sandbox solution.Go through the prerequisites to enable user code service on your farm. Enable User code service in your farm-- Tips: Don’t use WSP Builder menu for Sandbox solutions, use Retract,Deply…etc options from the Project properties menu.Try to do a change in UI and redeploy your wsp, the old webpart UI still cached, Resolve: Remove the webpart from webpart gallery.
  3. Inert: Not effectiveIt’s called also : Sandbox Solution model process: 4 phases: Upload stageActivation stageDeactivation stage: pages with web parts will shows an error message.Delete Stage: cant be deleted if the solution is activated. If deleted it goes to the site recycle bin and can be deleted or restored.Upgrade Stage
  4. Activate/ Deactivate/ Delete and restore.
  5. Path for the configuration for the sandbox solution is:C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14CONFIGFile name: wss_usercode.config
  6. How to get VS 2010 SP power tools:From VS tools -&gt; Extension manager and Top Ranked Extensions.
  7. Open SPSNYCDemo2Try to build - &gt; Get an error since the SPSecurity in not available in sandbox solutions.Change the project target to farm solution and try to build -&gt; 0 errors.This is only applied on: VS 2010 Power tools. This is your validation for Sandbox solutions.Details:http://visualstudiogallery.msdn.microsoft.com/en-us/8e602a8c-6714-4549-9e95-f3700344b0d9
  8. To show how to load balance the sandbox solutions:Central AdministrationSystem SettingsManage User Solutions All user requests will be executed on the same machine - &gt;Users’ requests are routed using solution affinity.Try to blocksharepoint solution and navigate to the webpart page. You will see the block message is appearing.
  9. Farm solution.
  10. Only 14 metric:http://msdn.microsoft.com/en-us/magazine/ee335711.aspx
  11. From Central admin -&gt; application management -&gt; Configure quotas and locks