Managing the SharePoint 2010 Application Lifecycle - Part 2

21
Managing the SharePoint Application Lifecycle – beyond version 1.0.0.0 PART 2 DEV108 Chris O’Brien - MVP

description

The second of two presentations from SharePoint Evolutions conference, aimed at SharePoint developers - covers new capabilities of SharePoint 2010 in managing changes and upgrades to exisitng apps.

Transcript of Managing the SharePoint 2010 Application Lifecycle - Part 2

Page 1: Managing the SharePoint 2010 Application Lifecycle - Part 2

Managing the SharePoint Application Lifecycle – beyond

version 1.0.0.0PART 2

DEV108

Chris O’Brien - MVP

Page 2: Managing the SharePoint 2010 Application Lifecycle - Part 2

Chris O’Brien, MVP, MCSD.Net, MCTS www.sharepointnutsandbolts.com Twitter: @ChrisO_Brien

Hands-on developer Author of ALM chapter in MVP book Creator of Content Deployment Wizard tool Regular speaker at UK user group

Page 3: Managing the SharePoint 2010 Application Lifecycle - Part 2

Last time..

Upgrading a SharePoint application

• SP2010 upgradable Features• How to version a Feature• Using code/XML to upgrade

Initial build • Feature framework changes• Leveraging WSP import

Page 4: Managing the SharePoint 2010 Application Lifecycle - Part 2

Today’s focus

Upgrading a SharePoint application

• How to upgrade different artifacts

• Changes to WSP framework

• Assembly versioning in SP2010

• Versioning recommendations

Page 5: Managing the SharePoint 2010 Application Lifecycle - Part 2

Recap – Feature upgrade

Page 6: Managing the SharePoint 2010 Application Lifecycle - Part 2

Versioning/upgrading Features

Version attribute now has a purpose! Define what should occur in 1.0.0.0-2.0.0.0

UpgradeActions element XML – some new XML for common

scenarios Code – specify method/parameters in

CustomUpgradeActions element– New FeatureUpgrading method – add logic here

Page 7: Managing the SharePoint 2010 Application Lifecycle - Part 2

Feature upgrade XML

ApplyElementManifests Integrate new artifacts into existing Feature Sometimes all you need!

AddContentTypeField Add columns to content type

MapFile Repoint a file to new location on filesystem

(uncustomized files only)

Page 8: Managing the SharePoint 2010 Application Lifecycle - Part 2

Demo

UPGRADING A FEATUREUpdating functionality

Page 9: Managing the SharePoint 2010 Application Lifecycle - Part 2

Artifact upgrade

Page 10: Managing the SharePoint 2010 Application Lifecycle - Part 2

Upgrade - ‘provisioned’ artifacts

Typically must use API:

Artifact Upgrade

Field, list instance, view, content type binding, document convertor

• Use API

‘Standard’ cases

Content type • Use AddContentTypeField• Use API

Module (file) • Uncustomized: • Overwrite file on

filesystem• Use MapFile

• Customized: • Overwrite file in

library

Page 11: Managing the SharePoint 2010 Application Lifecycle - Part 2

Upgrade - ‘declarative’ artifacts

Artifact Upgrade

Control (delegate control), CustomAction, Feature staple, workflow template

• Update XML

Typically update file on filesystem:

‘Standard’ cases

List definition • Update schema.xml (carefully!)• Deploy new list definition, mark

old as hidden

Site definition • New sites - staple new Feature• Existing sites – activate Feature

(script?)• OR upgrade existing Feature

Page 12: Managing the SharePoint 2010 Application Lifecycle - Part 2

‘Upgrading workflows

Special considerations Deserialization errors after upgrade

Typically ensure new instances use new SPWorkflowAssociation to new assembly– Allow running instances to complete using old

assembly

Page 13: Managing the SharePoint 2010 Application Lifecycle - Part 2

WSP framework

Page 14: Managing the SharePoint 2010 Application Lifecycle - Part 2

Solution framework changes

Resource files Resx files can now target

App_GlobalResources folder

Solution dependencies But not solution receivers

Assembly binding redirects

Page 15: Managing the SharePoint 2010 Application Lifecycle - Part 2

Dealing with shared assemblies

Solution dependencies: Does not deploy dependent solution Only checks at deployment time – possible

to retract a depended on solution Redirects help for versioning assemblies:

Version numbers stored everywhere! Redirect = one place to update

Page 16: Managing the SharePoint 2010 Application Lifecycle - Part 2

Demo

ASSEMBLY VERSIONINGUpdating functionality

Page 17: Managing the SharePoint 2010 Application Lifecycle - Part 2

Versioning strategies - ?.?.?.?

Assembly versioning – tracing back: Main thing is to increment in some way Common plans - Major.Minor.Build.Revision:

– Change severity (breaking/major/minor) – Shipping/non-shipping (product-oriented)– Incorporate sprint/iteration– Incorporate changeset number– Other custom

Consider ‘File version’ for internal versioning

Page 18: Managing the SharePoint 2010 Application Lifecycle - Part 2

Versioning strategies - ?.?.?.?

Feature versioning: Main purpose - identify which version is

where across farm Use similar principles as assemblies:

– Increment major for large/new release changes

Assembly/Feature versions will diverge Keep release notes to track

Page 19: Managing the SharePoint 2010 Application Lifecycle - Part 2

Summary

Now have standardized framework for upgrading applications New XML e.g. AddFieldToContentType Implement code in FeatureUpgrading event

Use the new capabilities! WSP import Solution dependencies for shared

assemblies

Page 20: Managing the SharePoint 2010 Application Lifecycle - Part 2

Closing thoughts

If you didn’t before, now is the time to do versioning! Assemblies -> AssembyBindingRedirect Features -> Feature upgrade code/XML

Some extra considerations, but big benefits for non-trivial apps

Page 21: Managing the SharePoint 2010 Application Lifecycle - Part 2

Thank you for attending!