SlideShare a Scribd company logo
Thinking SharePoint? Think Jornata.




               Just Freakin’ Work!
   Avoiding Common Hurdles in SharePoint
                    Development

Prepared for
Prepared by
                 Geoff Varosky
                  Jornata
                  61-63 Chatham Street

                     Jornata
                  Fourth Floor
                  Boston, MA 02109
Submitted on       December 14, 2011
About Me
• Geoff Varosky
  – Jornata – www.jornata.com
     •   Director, Development & Evangelism
     •   Blogger, Speaker
     •   BASPUG Co-Founder
     •   SPS Boston Co-Organizer
  – Blog : www.sharepointyankee.com
  – Email: geoff.varosky@jornata.com
  – Twitter: @gvaro
  – LinkedIn & Facebook
                email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro
                                                                                                                     2
                Thinking SharePoint? Think Jornata.
You might be a SharePoint Developer if…




           email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

           Thinking SharePoint? Think Jornata.
Agenda
•   Introduction
•   Development
•   Deployment
•   Resources
•   Q&A




              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
Introduction
•   Types of Development
•   Development Tools
•   Development Environment
•   Developing to Deploy




              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
Introduction
• Types of Development
  – Unmanaged Code
  – Managed Code
  – Customization




           email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

           Thinking SharePoint? Think Jornata.
Introduction
• Development Tools
  – STSDEV (2007)
     • stsdev.codeplex.com
  – WSPBuilder (2007 & 2010)
     • wspbuilder.codeplex.com
  – CKS:DEV (2010)
     • cksdev.codeplex.com
  – SharePoint Designer


              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
Introduction
• Development Environment
  – Physical?
  – Virtual?
  – Desktop?
  – Dusty old PC under the desk?




             email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

             Thinking SharePoint? Think Jornata.
Introduction
• 2007 or 2010
  – 64-bit (leaves room for upgrade)
  – >= 4G of RAM
  – Choice of Virtual Host
     • HyperV, VMWare, VirtualBox
     • Not much in the way of VirtualPC support
  – Create a base virtual image
     • SQL, Base SP install, Service Packs, Dev Tools
     • Visual Studio, SPD, etc.

               email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

               Thinking SharePoint? Think Jornata.
Introduction
• Development Environment
  – Follow the SDK (2010)
     • 64 bit
     • Desktop
        – Windows 7
        – Vista (SP1+)
        – Http://msdn.microsoft.com/en-us/library/ee554869.aspx
     • Server 2008




              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
Introduction
• Development Environment
  – Make sure your environment matches deployment
    targets!
    • In Visual Studio
       – CPU
           » x86? x64? AnyCPU?
    • .NET Framework
    • Service Packs
    • Same architecture


              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
Introduction
• Development Environment
  – Don’t do everything as local admin!
     • Follow proper account configuration from the SDK


• Developing to Deploy
  – Use the least amount of privileges
     • This will make admins happy
  – Web application deployment (/bin)
     • CAS policies

               email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

               Thinking SharePoint? Think Jornata.
Development
•   General Development Practices
•   Lists
•   Event Receivers
•   Web Parts
•   Unmanaged Code




              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
Development
• General Development Practices
  – Dispose of Objects!
     • SPDisposeCheck
  – Test with multiple accounts/privileges
  – Strongly named assemblies
  – Separate high and low privileged DLLs
  – Do not mix .NET Framework versions
  – 64 bit code compatibility

             email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

             Thinking SharePoint? Think Jornata.
Development
• General Development Practices
  – Stay away from the database
     • USE THE API!
  – Use resource & language files
     • Do not hard code strings and labels
  – Caching when and where possible
     • msdn.microsoft.com/library/bb687949.aspx
  – CAS Policies
  – Safe Controls
              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
Development
• General Development Practices
  – Use try{} catch{} finally{} blocks
  – Check for nulls in finally{} blocks with disposable
    objects before disposing
• Change defaults
  – Assembly Info
• Name it properly
  – Jornata.SharePoint.WebParts.Stuff

              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
Development
• General Development Practices
  – Sign Controls
     • Do not password protect the SNK
  – Elevating Privileges
     • SPSecurity.RunWithElevatedPrivileges()
        – Clean, Validated, Secure data
        – Runs as System account
        – Write operations?
            » Preceeded by SPUtility|SPWeb.ValidateFormDigest
        – Must use new SPSite or SPWeb – not SPContext.Current


              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
You might be a SharePoint Developer if…




           email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

           Thinking SharePoint? Think Jornata.
Development
• Lists
   – Test queries before deployment!
   – U2U CAML Query Builder
      • Remove the <Query></Query> tags!
   – LINQ
   – Batch queries when possible




              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
Development
• Lists
   – Do not use SPList.Items
      • Use SPList.GetItems(query)
      • Paginate (2000 items) – RowLimit
   – GetItemByID
      • Use SPList.GetitemByID
      • Not SPList.Items.GetItemByID




               email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

               Thinking SharePoint? Think Jornata.
Development
• Event Handlers
  – Do not instantiate SPWeb, SPSite, SPList, or
    SPListItem
  – Use what the properties give you
     • properties.OpenWeb()
        – Do not need to dispose
     • properties.ListItem
  – Bulk operations will not run event handlers
     • Ex: New list created – FieldAdding will not run

               email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

               Thinking SharePoint? Think Jornata.
Development
• Event Handlers
  – Connections
     • Make sure you code for external systems not being
       available
  – LOG ERRORS
     • Make it known why something went wrong




              Thinking SharePoint? Think Jornata.
Development
• Web Parts
  – Deploy to the Web Part Gallery
     • Easy to add to a page from there
  – AllowClose = false
     • Closing web parts = bad
     • X DOES NOT EQUAL DELETE
  – Use Properties – avoid hard coded values
  – HTMLEncode input values


              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
Development
• Web Parts – In Code
  – EnsureChildControls
     • Ensure that the controls have been loaded before using
       them.




              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
Development
• Unmanaged Code
  – JavaScript
     • Will this be used in more than one place?
     • Central Script repository (easy access)
     • Deployment to _layouts folder
        – More of a “managed” approach, more secure
        – Less flexible




              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
Development
• Unmanaged Code
  – Content Editor Web Parts
     • Awesome, flexible web parts!
     • Use a library with versioning to link the WP to
        – Easier to manage
        – Versioning of “code”
  – Publishing Sites
     • Use content controls, not CEWPs!



               email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

               Thinking SharePoint? Think Jornata.
Development
• Unmanaged Code
  – Ghosted v. Unghosted pages
    • Uncustomized v. customized
    • Unghosted pages can have issues with upgrades
       – i.e. site definitions change with upgrades
    • Branding




              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
You might be a SharePoint Developer if…




           email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

           Thinking SharePoint? Think Jornata.
Development
• User Code Solutions (2010)
  – When possible
  – Forces better programming practices
  – Keeps the farm safe
     • Makes admins & managers happy
  – Admins can control
     • Makes them feel special




              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
Development
•   USE SOLUTION PACKAGES!
•   USE SOLUTION PACKAGES!
•   USE SOLUTION PACKAGES!
•   USE SOLUTION PACKAGES!
•   USE SOLUTION PACKAGES!
•   USE SOLUTION PACKAGES!
•   USE SOLUTION PACKAGES!
•   USE SOLUTION PACKAGES!
             email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

            Thinking SharePoint? Think Jornata.
Resources
• Development Tools
  – Codeplex.com
    • Search SharePoint & Development
  – SharePointDevWiki.com
    • www.sharepointdevwiki.com/display/public/SharePoint
      +Development+Tools
  – SPDisposeCheck
    • code.msdn.microsoft.com/SPDisposeCheck



             email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

             Thinking SharePoint? Think Jornata.
Resources
• SDKs
  – 2010
    • Server and Foundation
         – http://msdn.microsoft.com/en-us/library/ee557253.aspx
  – 2007
    • WSS
         – http://msdn.microsoft.com/en-
           us/library/ms441339(office.12).aspx
    • MOSS 2007
         – http://msdn.microsoft.com/en-
           us/library/ms550992(office.12).aspx
                email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

                Thinking SharePoint? Think Jornata.
Resources
• General Development
  – Roger Lamb’s Blog
     • blogs.msdn.com/rogerla/
  – Patterns & Practices SharePoint Guidance
     • msdn.microsoft.com/en-us/library/dd203468.aspx
  – Using Disposable Objects
     • msdn.microsoft.com/en-
       us/library/aa973248(v=office.12).aspx



              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
Resources
• General Development
  – Working with Large Lists
     • go.microsoft.com/fwlink?LinkId=95450
  – SharePoint 2007 Best Practices Resource Center
     • technet.microsoft.com/en-
       us/office/sharepointserver/bb736746.aspx




              email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

              Thinking SharePoint? Think Jornata.
You… BEFORE session…




          email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

          Thinking SharePoint? Think Jornata.
You… AFTER session…




          email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro

          Thinking SharePoint? Think Jornata.
email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro
                                                                                                    37
Thinking SharePoint? Think Jornata.
Q&A
email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro
                                                                                                    38
Thinking SharePoint? Think Jornata.
•   Meets 2nd Wednesday/Month
•   6P – 8PM
•   Microsoft Waltham & Cambridge
•   http://www.bostonsharepointug.org
•   Twitter: @BASPUG / #BASPUG


            email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro
                                                                                                                39
            Thinking SharePoint? Think Jornata.
About Me
• Geoff Varosky
  – Jornata – www.jornata.com
     •   Director, Development & Evangelism
     •   Blogger, Speaker
     •   BASPUG Co-Founder
     •   SPS Boston Co-Organizer
  – Blog : www.sharepointyankee.com
  – Email: geoff.varosky@jornata.com
  – Twitter: @gvaro
  – LinkedIn & Facebook
                email: geoff.varosky@jornata.com | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro
                                                                                                                    40
                Thinking SharePoint? Think Jornata.

More Related Content

What's hot (20)

PDF
Engage 2019: Modernising Your Domino and XPages Applications
Paul Withers
 
KEY
Freelancing and side-projects on Rails
John McCaffrey
 
PPTX
Engage 2019 - De04. Java with Domino After XPages
Jesse Gallagher
 
KEY
WordPress APIs
mdawaffe
 
PDF
REST In Action: The Live Coverage Platform at the New York Times
Scott Taylor
 
PPTX
Untangling the web11
Derek Jacoby
 
PPTX
Untangling spring week8
Derek Jacoby
 
PDF
WordPress: Getting Under the Hood
Scott Taylor
 
PDF
2015 WordCamp Maine Keynote
Scott Taylor
 
PPTX
Untangling spring week4
Derek Jacoby
 
PPT
Windy cityrails performance_tuning
John McCaffrey
 
PDF
eMusic: WordPress in the Enterprise
Scott Taylor
 
PPTX
SPSDenver - SharePoint & jQuery - What I wish I would have known
Mark Rackley
 
PDF
Modern websites in 2020 and Joomla
George Wilson
 
KEY
improving the performance of Rails web Applications
John McCaffrey
 
PDF
Live Coverage at The New York Times
Scott Taylor
 
PDF
State of jQuery June 2013 - Portland
dmethvin
 
PPTX
Engage 2019 Software documentation is fun if you have the right tools: Introd...
AndrewMagerman
 
KEY
Developing High Performance Web Apps - CodeMash 2011
Timothy Fisher
 
PDF
Play framework 2 : Peter Hilton
JAX London
 
Engage 2019: Modernising Your Domino and XPages Applications
Paul Withers
 
Freelancing and side-projects on Rails
John McCaffrey
 
Engage 2019 - De04. Java with Domino After XPages
Jesse Gallagher
 
WordPress APIs
mdawaffe
 
REST In Action: The Live Coverage Platform at the New York Times
Scott Taylor
 
Untangling the web11
Derek Jacoby
 
Untangling spring week8
Derek Jacoby
 
WordPress: Getting Under the Hood
Scott Taylor
 
2015 WordCamp Maine Keynote
Scott Taylor
 
Untangling spring week4
Derek Jacoby
 
Windy cityrails performance_tuning
John McCaffrey
 
eMusic: WordPress in the Enterprise
Scott Taylor
 
SPSDenver - SharePoint & jQuery - What I wish I would have known
Mark Rackley
 
Modern websites in 2020 and Joomla
George Wilson
 
improving the performance of Rails web Applications
John McCaffrey
 
Live Coverage at The New York Times
Scott Taylor
 
State of jQuery June 2013 - Portland
dmethvin
 
Engage 2019 Software documentation is fun if you have the right tools: Introd...
AndrewMagerman
 
Developing High Performance Web Apps - CodeMash 2011
Timothy Fisher
 
Play framework 2 : Peter Hilton
JAX London
 

Viewers also liked (12)

PPT
CVNUG - Share Point Development
ryanaoliveira
 
PPTX
Securing SharePoint Apps with OAuth
Kashif Imran
 
PPTX
SharePoint Permissions Overview
Francois Pienaar
 
PPTX
SharePoint Security A to Z
Steve Goldberg
 
PPTX
Solving business problems: No-code approach with SharePoint designer workflow...
Bhakthi Liyanage
 
PPTX
SharePoint Development(Lesson 5)
MJ Ferdous
 
PPTX
SharePoint Permissions 101
Thomas Duff
 
PPTX
Governance of content, permissions & apps in sharepoint 2013
Kashish Sukhija
 
PDF
SharePoint Security Management - Lessons Learned
Benjamin Niaulin
 
PPTX
Best practices for Security and Governance in SharePoint 2013
AntonioMaio2
 
PPTX
SharePoint Permissions Worst Practices
Bobby Chang
 
PPTX
Best Practices for Security in Microsoft SharePoint 2013
AntonioMaio2
 
CVNUG - Share Point Development
ryanaoliveira
 
Securing SharePoint Apps with OAuth
Kashif Imran
 
SharePoint Permissions Overview
Francois Pienaar
 
SharePoint Security A to Z
Steve Goldberg
 
Solving business problems: No-code approach with SharePoint designer workflow...
Bhakthi Liyanage
 
SharePoint Development(Lesson 5)
MJ Ferdous
 
SharePoint Permissions 101
Thomas Duff
 
Governance of content, permissions & apps in sharepoint 2013
Kashish Sukhija
 
SharePoint Security Management - Lessons Learned
Benjamin Niaulin
 
Best practices for Security and Governance in SharePoint 2013
AntonioMaio2
 
SharePoint Permissions Worst Practices
Bobby Chang
 
Best Practices for Security in Microsoft SharePoint 2013
AntonioMaio2
 
Ad

Similar to Best Practices in SharePoint Development - Just Freakin Work! Overcoming Hurdles and Avoiding Pain in SharePoint Development (20)

PPTX
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
PDF
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
PPTX
The Ribbon UI and Custom Actions in SharePoint 2010
Geoff Varosky
 
PPTX
Jornata llc sps baltimore 2012 - share point branding
jcsturges
 
PDF
What is share point sps_denver_final
M Allmond
 
PPTX
Share Point Best Practices
guest17ee6d
 
PPTX
Share Point Best Practices
Jeremy Thake
 
PPTX
Creating Custom Actions in SharePoint 2010
Geoff Varosky
 
PPTX
Top 10 Performance Tips for Making your Public Facing SharePoint 2010 Site Fa...
Kanwal Khipple
 
PPTX
Spsnh geoff varosky - jornata - planning and configuring extranets in share...
Geoff Varosky
 
PPT
Sharepoint Presentation
PRAKHYATH S RAI
 
PPTX
Share point 2010 sp1 enterprise edition sps bos presentation no 4323234
Matthew Carter
 
PPTX
Creating an Amazing Intranet
haiyankhan
 
PPTX
Planning and Configuring Extranets in SharePoint 2010 @ SharePoint Saturday N...
Geoff Varosky
 
PPTX
Optimizing SharePoint 2010 for Internet sites
Kanwal Khipple
 
PPTX
Modernize Solutions with SharePoint & the Power Platform
Jonathan Schultz
 
PPTX
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
PPTX
SPS Ottawa 2019: From the field: Modernize your SharePoint Intranet with Shar...
Nicolas Georgeault
 
PPTX
Searching for SharePoint Analytics
Jeff Fried
 
PDF
SharePoint Custom Development
C/D/H Technology Consultants
 
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
The Ribbon UI and Custom Actions in SharePoint 2010
Geoff Varosky
 
Jornata llc sps baltimore 2012 - share point branding
jcsturges
 
What is share point sps_denver_final
M Allmond
 
Share Point Best Practices
guest17ee6d
 
Share Point Best Practices
Jeremy Thake
 
Creating Custom Actions in SharePoint 2010
Geoff Varosky
 
Top 10 Performance Tips for Making your Public Facing SharePoint 2010 Site Fa...
Kanwal Khipple
 
Spsnh geoff varosky - jornata - planning and configuring extranets in share...
Geoff Varosky
 
Sharepoint Presentation
PRAKHYATH S RAI
 
Share point 2010 sp1 enterprise edition sps bos presentation no 4323234
Matthew Carter
 
Creating an Amazing Intranet
haiyankhan
 
Planning and Configuring Extranets in SharePoint 2010 @ SharePoint Saturday N...
Geoff Varosky
 
Optimizing SharePoint 2010 for Internet sites
Kanwal Khipple
 
Modernize Solutions with SharePoint & the Power Platform
Jonathan Schultz
 
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
SPS Ottawa 2019: From the field: Modernize your SharePoint Intranet with Shar...
Nicolas Georgeault
 
Searching for SharePoint Analytics
Jeff Fried
 
SharePoint Custom Development
C/D/H Technology Consultants
 
Ad

More from Geoff Varosky (20)

PPTX
Using Azure Runbooks and Microsoft Flow to Automate SharePoint Tasks
Geoff Varosky
 
PPTX
Automating Enterprise Application Deployments with PowerShell
Geoff Varosky
 
PDF
Automating Your Enterprise Application Deployments with PowerShell
Geoff Varosky
 
PDF
The Ribbon UI and Custom Actions in SharePoint 2010
Geoff Varosky
 
PDF
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
PPTX
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
PPTX
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
PPTX
Who? What? Where? Searching in SharePoint
Geoff Varosky
 
PPTX
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
PPTX
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
PPTX
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
PPTX
SharePoint Saturday Hartford - 01/29/11 - Creating Custom Actions in SharePoi...
Geoff Varosky
 
PPTX
SharePoint Saturday EMEA - The Ribbon UI and Custom Actions in SharePoint 2010
Geoff Varosky
 
PDF
Creating Custom Actions in SharePoint 2010
Geoff Varosky
 
PDF
Just Freakin' Work - Overcoming Hurdles and Avoiding Pain
Geoff Varosky
 
PPTX
Creating Custom Actions in SharePoint 2010
Geoff Varosky
 
PPTX
From SharePoint Designer to Visual Studio - Prototyping and Deploying Solutio...
Geoff Varosky
 
PPTX
What's New for Developers in SharePoint 2010
Geoff Varosky
 
PPTX
Creating Custom Actions within SharePoint
Geoff Varosky
 
PPTX
SharePoint Saturday Boston 2/27/10 - Whats New For Developers In SharePoint 2010
Geoff Varosky
 
Using Azure Runbooks and Microsoft Flow to Automate SharePoint Tasks
Geoff Varosky
 
Automating Enterprise Application Deployments with PowerShell
Geoff Varosky
 
Automating Your Enterprise Application Deployments with PowerShell
Geoff Varosky
 
The Ribbon UI and Custom Actions in SharePoint 2010
Geoff Varosky
 
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
Who? What? Where? Searching in SharePoint
Geoff Varosky
 
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
Planning and Configuring Extranets in SharePoint 2010
Geoff Varosky
 
SharePoint Saturday Hartford - 01/29/11 - Creating Custom Actions in SharePoi...
Geoff Varosky
 
SharePoint Saturday EMEA - The Ribbon UI and Custom Actions in SharePoint 2010
Geoff Varosky
 
Creating Custom Actions in SharePoint 2010
Geoff Varosky
 
Just Freakin' Work - Overcoming Hurdles and Avoiding Pain
Geoff Varosky
 
Creating Custom Actions in SharePoint 2010
Geoff Varosky
 
From SharePoint Designer to Visual Studio - Prototyping and Deploying Solutio...
Geoff Varosky
 
What's New for Developers in SharePoint 2010
Geoff Varosky
 
Creating Custom Actions within SharePoint
Geoff Varosky
 
SharePoint Saturday Boston 2/27/10 - Whats New For Developers In SharePoint 2010
Geoff Varosky
 

Recently uploaded (20)

PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
The Future of Artificial Intelligence (AI)
Mukul
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 

Best Practices in SharePoint Development - Just Freakin Work! Overcoming Hurdles and Avoiding Pain in SharePoint Development

  • 1. Thinking SharePoint? Think Jornata. Just Freakin’ Work! Avoiding Common Hurdles in SharePoint Development Prepared for Prepared by Geoff Varosky Jornata 61-63 Chatham Street Jornata Fourth Floor Boston, MA 02109 Submitted on December 14, 2011
  • 2. About Me • Geoff Varosky – Jornata – www.jornata.com • Director, Development & Evangelism • Blogger, Speaker • BASPUG Co-Founder • SPS Boston Co-Organizer – Blog : www.sharepointyankee.com – Email: [email protected] – Twitter: @gvaro – LinkedIn & Facebook email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro 2 Thinking SharePoint? Think Jornata.
  • 3. You might be a SharePoint Developer if… email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 4. Agenda • Introduction • Development • Deployment • Resources • Q&A email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 5. Introduction • Types of Development • Development Tools • Development Environment • Developing to Deploy email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 6. Introduction • Types of Development – Unmanaged Code – Managed Code – Customization email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 7. Introduction • Development Tools – STSDEV (2007) • stsdev.codeplex.com – WSPBuilder (2007 & 2010) • wspbuilder.codeplex.com – CKS:DEV (2010) • cksdev.codeplex.com – SharePoint Designer email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 8. Introduction • Development Environment – Physical? – Virtual? – Desktop? – Dusty old PC under the desk? email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 9. Introduction • 2007 or 2010 – 64-bit (leaves room for upgrade) – >= 4G of RAM – Choice of Virtual Host • HyperV, VMWare, VirtualBox • Not much in the way of VirtualPC support – Create a base virtual image • SQL, Base SP install, Service Packs, Dev Tools • Visual Studio, SPD, etc. email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 10. Introduction • Development Environment – Follow the SDK (2010) • 64 bit • Desktop – Windows 7 – Vista (SP1+) – Http://msdn.microsoft.com/en-us/library/ee554869.aspx • Server 2008 email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 11. Introduction • Development Environment – Make sure your environment matches deployment targets! • In Visual Studio – CPU » x86? x64? AnyCPU? • .NET Framework • Service Packs • Same architecture email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 12. Introduction • Development Environment – Don’t do everything as local admin! • Follow proper account configuration from the SDK • Developing to Deploy – Use the least amount of privileges • This will make admins happy – Web application deployment (/bin) • CAS policies email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 13. Development • General Development Practices • Lists • Event Receivers • Web Parts • Unmanaged Code email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 14. Development • General Development Practices – Dispose of Objects! • SPDisposeCheck – Test with multiple accounts/privileges – Strongly named assemblies – Separate high and low privileged DLLs – Do not mix .NET Framework versions – 64 bit code compatibility email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 15. Development • General Development Practices – Stay away from the database • USE THE API! – Use resource & language files • Do not hard code strings and labels – Caching when and where possible • msdn.microsoft.com/library/bb687949.aspx – CAS Policies – Safe Controls email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 16. Development • General Development Practices – Use try{} catch{} finally{} blocks – Check for nulls in finally{} blocks with disposable objects before disposing • Change defaults – Assembly Info • Name it properly – Jornata.SharePoint.WebParts.Stuff email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 17. Development • General Development Practices – Sign Controls • Do not password protect the SNK – Elevating Privileges • SPSecurity.RunWithElevatedPrivileges() – Clean, Validated, Secure data – Runs as System account – Write operations? » Preceeded by SPUtility|SPWeb.ValidateFormDigest – Must use new SPSite or SPWeb – not SPContext.Current email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 18. You might be a SharePoint Developer if… email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 19. Development • Lists – Test queries before deployment! – U2U CAML Query Builder • Remove the <Query></Query> tags! – LINQ – Batch queries when possible email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 20. Development • Lists – Do not use SPList.Items • Use SPList.GetItems(query) • Paginate (2000 items) – RowLimit – GetItemByID • Use SPList.GetitemByID • Not SPList.Items.GetItemByID email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 21. Development • Event Handlers – Do not instantiate SPWeb, SPSite, SPList, or SPListItem – Use what the properties give you • properties.OpenWeb() – Do not need to dispose • properties.ListItem – Bulk operations will not run event handlers • Ex: New list created – FieldAdding will not run email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 22. Development • Event Handlers – Connections • Make sure you code for external systems not being available – LOG ERRORS • Make it known why something went wrong Thinking SharePoint? Think Jornata.
  • 23. Development • Web Parts – Deploy to the Web Part Gallery • Easy to add to a page from there – AllowClose = false • Closing web parts = bad • X DOES NOT EQUAL DELETE – Use Properties – avoid hard coded values – HTMLEncode input values email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 24. Development • Web Parts – In Code – EnsureChildControls • Ensure that the controls have been loaded before using them. email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 25. Development • Unmanaged Code – JavaScript • Will this be used in more than one place? • Central Script repository (easy access) • Deployment to _layouts folder – More of a “managed” approach, more secure – Less flexible email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 26. Development • Unmanaged Code – Content Editor Web Parts • Awesome, flexible web parts! • Use a library with versioning to link the WP to – Easier to manage – Versioning of “code” – Publishing Sites • Use content controls, not CEWPs! email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 27. Development • Unmanaged Code – Ghosted v. Unghosted pages • Uncustomized v. customized • Unghosted pages can have issues with upgrades – i.e. site definitions change with upgrades • Branding email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 28. You might be a SharePoint Developer if… email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 29. Development • User Code Solutions (2010) – When possible – Forces better programming practices – Keeps the farm safe • Makes admins & managers happy – Admins can control • Makes them feel special email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 30. Development • USE SOLUTION PACKAGES! • USE SOLUTION PACKAGES! • USE SOLUTION PACKAGES! • USE SOLUTION PACKAGES! • USE SOLUTION PACKAGES! • USE SOLUTION PACKAGES! • USE SOLUTION PACKAGES! • USE SOLUTION PACKAGES! email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 31. Resources • Development Tools – Codeplex.com • Search SharePoint & Development – SharePointDevWiki.com • www.sharepointdevwiki.com/display/public/SharePoint +Development+Tools – SPDisposeCheck • code.msdn.microsoft.com/SPDisposeCheck email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 32. Resources • SDKs – 2010 • Server and Foundation – http://msdn.microsoft.com/en-us/library/ee557253.aspx – 2007 • WSS – http://msdn.microsoft.com/en- us/library/ms441339(office.12).aspx • MOSS 2007 – http://msdn.microsoft.com/en- us/library/ms550992(office.12).aspx email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 33. Resources • General Development – Roger Lamb’s Blog • blogs.msdn.com/rogerla/ – Patterns & Practices SharePoint Guidance • msdn.microsoft.com/en-us/library/dd203468.aspx – Using Disposable Objects • msdn.microsoft.com/en- us/library/aa973248(v=office.12).aspx email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 34. Resources • General Development – Working with Large Lists • go.microsoft.com/fwlink?LinkId=95450 – SharePoint 2007 Best Practices Resource Center • technet.microsoft.com/en- us/office/sharepointserver/bb736746.aspx email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 35. You… BEFORE session… email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 36. You… AFTER session… email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro Thinking SharePoint? Think Jornata.
  • 37. email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro 37 Thinking SharePoint? Think Jornata.
  • 38. Q&A email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro 38 Thinking SharePoint? Think Jornata.
  • 39. Meets 2nd Wednesday/Month • 6P – 8PM • Microsoft Waltham & Cambridge • http://www.bostonsharepointug.org • Twitter: @BASPUG / #BASPUG email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro 39 Thinking SharePoint? Think Jornata.
  • 40. About Me • Geoff Varosky – Jornata – www.jornata.com • Director, Development & Evangelism • Blogger, Speaker • BASPUG Co-Founder • SPS Boston Co-Organizer – Blog : www.sharepointyankee.com – Email: [email protected] – Twitter: @gvaro – LinkedIn & Facebook email: [email protected] | web: www.jornata.com | blog: www.sharepointyankee.com | twitter: @gvaro 40 Thinking SharePoint? Think Jornata.