+ All Categories
Home > Documents > Upgrading customized solutions in SharePoint from 2007 to 2010

Upgrading customized solutions in SharePoint from 2007 to 2010

Date post: 24-Dec-2014
Category:
Upload: shai-petel
View: 1,520 times
Download: 4 times
Share this document with a friend
Description:
Overview of visual studio 2010 extensions for SharePoint 2010, tips, tricks, upgrading exsiting 2007 customizations, and version management.This is a developer oriented presentation
Popular Tags:
97
Case Study: Upgrading SLFE from 2007 to 2010 Shai Petel ([email protected]) VP R&D, Microsoft Certified Trainer KWizCom Corporation
Transcript
Page 1: Upgrading customized solutions in SharePoint from 2007 to 2010

Case Study: Upgrading SLFE

from 2007 to 2010Shai Petel ([email protected])VP R&D, Microsoft Certified Trainer

KWizCom Corporation

Page 2: Upgrading customized solutions in SharePoint from 2007 to 2010

Content

• Building a new solution• Upgrading an existing solution• Version management

Page 3: Upgrading customized solutions in SharePoint from 2007 to 2010

GoalsIn this session you will learn about the new VS2010

extensions for WSSYou will learn how to migrate your existing

solutions into the new environment reducing the migration process time to minimum.

This session will allow you to make better decisions on your current solutions for 2007 today that will make the transition to 2010 easy and simple.

Page 4: Upgrading customized solutions in SharePoint from 2007 to 2010

Content• Building a new solution

– Creating a new solution– Setup trust level– Choose a project template– Adding new components– One-click deploy or package

• Upgrading an existing solution• Version management

Page 5: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New Solution Before you begin…

• Is your team ready for 2010?– Silverlight, Ajax, JSON– Visual web parts! (or is it?)

• Prepare to be hosted!– Limit customization to site collection level– Prefer to support sandboxed solutions*

Page 6: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New Solution

Before you begin…Creating a new web part?Inherit from

ASP.NET!• SharePoint web parts are still supported for backwards compatibility

• Do not change base for existing web parts!!!

Page 7: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionBefore you begin…

Before you begin… you will need to set up your development environment:• Visual studio 2010 + VSeWSS• SharePoint Designer

Choose your development environment setup

• Install in one• Client / server• Virtualize! (recommended).

Page 8: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New Solution Before you begin…

- Install all components on developer machinehttp://msdn.microsoft.com/en-us/library/ee554869.aspx - Setting Up the Development Environment for SharePoint 2010 on Windows Vista, Windows 7, and Windows Server 2008

Pros Cons

Performance

Slower Hardware

Developer control

Isolated

Easy to mess up

Hard to backup

WinVistaSP2/7/2

k8 64bit only

Page 9: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New Solution Before you begin…

• Install developer components on development client and use remote debugger to connect to development server (not so bad, but still…)

Pros Cons

Performance

Slower computers

Hard to mess up

the server

Easy to backup

No control on farm

Not isolated

Hard to develop

Page 10: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New Solution Before you begin…

• Virtualize! (Recommended) Pros Cons

Restore

Backup, duplicate, portable!

Developer full

control on farm

Isolated

Strong computer

64bit Virtualization

only

Page 11: Upgrading customized solutions in SharePoint from 2007 to 2010

Content• Building a new solution

– Creating a new solution– Setup trust level– Choose a project template– Adding new components– One-click deploy or package

• Upgrading an existing solution• Version management

Page 12: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionCreating a new solution

• Open VS2010

Page 13: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionCreating a new solution

• Click on new project. Go to:C# -> SharePoint -> 2010 templates

Page 14: Upgrading customized solutions in SharePoint from 2007 to 2010

Content• Building a new solution

– Creating a new solution– Setup trust level– Choose a project template– Adding new components– One-click deploy or package

• Upgrading an existing solution• Version management

Page 15: Upgrading customized solutions in SharePoint from 2007 to 2010

Introducing

Your very own sandbox!

Page 16: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionSetup trust level

• Choose your destiny

Page 17: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionSetup trust level

• To trust, or not to trust?– Sandbox solutions is a way for you to deploy a set of

features and components to your SharePoint site collection that will have no effect on other site collections

– Sandbox solutions have limited support for extensibility and not all SharePoint customizations are allowed

– Sandboxed solutions can be installed and deployed by site owner from site settings

Page 18: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionSetup trust level

• What does this setting change?– This setting does not get written to WSP package, but

will allow VS to validate your content is supported within a sandboxes solution

– Solution assemblies within a sandboxed solution are not installed to GAC/Bin, and not running on W3WP process. Instead they run under SPUCWorkerProcess

– Sandboxed solutions can be deployed as a full-trusted solution as well

Page 19: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionSetup trust level

• What is supported within a sandbox solution?– List Definitions, List Instances, Content Types/Fields– Web Parts (non visual)– Event receivers: Item, List or Web– Declarative workflows (No code)– Custom Actions (Ribbon)– Onet.xml, WebTemplate feature element (instead of

Webtemp.xml) allows for site collection level site definitions!

– More…

Page 20: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionSetup trust level

• What is not supported within a sandbox solution?– Mapped folders (14 hive)– Some API will not work in sandboxed mode– Visual Web Parts– Application Pages– Custom Action Group– HideCustomAction element– Web Application/Farm-scoped features– Workflows with code– Accessing the server side SPRibbon object

Page 21: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionSetup trust level

• How do I deploy a sandbox solution?

Upload to Solutions gallery

Activate

Page 22: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionSetup trust level

• Cannot activate solution?

• Go to central administration and make sure windows SharePoint user code service is started

Page 23: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionSetup trust level

• Sandboxed solution management in Central Admin:

Page 24: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionSetup trust level

• Keep in mind:– Site collection features will be activated by default

* Unless specifically specified not to in the feature

– To disable support for sandbox solutions simply stop the user code service.* Or administrator can block a specific solution from running

– Upgrading sandbox solutions are done manually, site collection at a time* You can run different versions on different site collections at the same time.

Page 25: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionSetup trust level

=2B |! 2B ? FullTrust:Sandbox;

Cons Pros

Performance

Resources

Upgrade

Beta friendly

Manageable

Page 26: Upgrading customized solutions in SharePoint from 2007 to 2010

Content• Building a new solution

– Creating a new solution– Setup trust level– Choose a project template– Adding new components– One-click deploy or package

• Upgrading an existing solution• Version management

Page 27: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose a project template

• There are a lot of new project templates to choose from!

• But fear not – You can easily add any component to any project later

• New templates are added all the time

Page 28: Upgrading customized solutions in SharePoint from 2007 to 2010

Introducing

Visual Web Part

Page 29: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Visual web part

• This project template cannot be sandboxed*

Page 31: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Visual web part

• Project created with all web part files for you

Page 32: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Visual web part

• A feature will be created for you automatically

Page 33: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Visual web part

• A package will be created for you automatically

Page 34: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Event receiver

• This project template can be sandboxed

Page 35: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Event receiver

“Create project” WizardNew

types of receiver

sNew

events to

handle!

Page 36: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Event receiver

• Adds all needed files for you

Page 37: Upgrading customized solutions in SharePoint from 2007 to 2010

Introducing

Business Connectivity Services

Page 38: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – BCS Model

• This project template can be sandboxed

Page 39: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – BCS Model

• BCS editing tools

Page 40: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – BCS Model

• Packaged and deployed as a farm level feature

Page 41: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Content type

• This project template can be sandboxed

Page 42: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Content type

“Create content type”

WizardMore work

needed on the wizard though

Page 43: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – List definition

• This project template can be sandboxed

Page 44: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Content type

“Create List

Def.” Wizard

Page 45: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Content type

Schema File

Create Elements file for featureOptiona

l: Create

list instance XML

Page 46: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Content type

• Packaged and deployed as a web feature

Page 47: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Workflow

• This project template cannot be sandboxed

Page 48: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Workflow

• Sequential workflow is designed to execute a series of predefined steps to accomplish a certain task

• State machine workflows are designed to work in event-driven scenarios. A state machine workflow contains two or more states, with one state being the active state at any given time

Page 49: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Workflow

“State machine”

wizard

Choose history and tasks lists.

* Also choose a list if you selected a

list workflow

type

Workflow initiation options

Page 50: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Workflow

• Designer has different options for site and list workflows

Page 51: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Workflow

• Add sequential workflow, with its own designer

Page 52: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – Workflow

• Creates separate elements file for each workflow

Page 53: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – New!

• Get “SharePoint 2010 Extensibility Projects” to add the following:– Silverlight and SharePoint project template– SharePoint Ribbon project template– OBA (Office Business Applications)

Deployment project templatehttp://code.msdn.microsoft.com/vsixforsp

Page 54: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionChoose template – New!

• Server Ribbon project:

Page 55: Upgrading customized solutions in SharePoint from 2007 to 2010

Content• Building a new solution

– Creating a new solution– Setup trust level– Choose a project template– Adding new components– One-click deploy or package

• Upgrading an existing solution• Version management

Page 56: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionAdding new components

• It is extremely easy to add any component to any project you like

• This allows you to easily create more complex solutions that includes several types of customizations such as:– Feature – for activation– Web parts – for visual UI– Lists and list definitions for storing data– Field types, event handlers, workflows and much more!

Page 57: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionAdding new components

• Add mapped folder

Page 58: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionAdding new components

• Add other components

Page 59: Upgrading customized solutions in SharePoint from 2007 to 2010

Content• Building a new solution

– Creating a new solution– Choose a project template– Setup trust level– Adding new components– One-click deploy or package

• Upgrading an existing solution• Version management

Page 60: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionOne-click deploy or package

• Feature and Package editors available

Page 61: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionOne-click deploy or package

Features and elements can be

shared across your visual studio

solution!

Page 62: Upgrading customized solutions in SharePoint from 2007 to 2010

Building a New SolutionOne-click deploy or package

• Project menu allows you to build, deploy to development server, and to package using a WSP– Build – compile code only– Package – compiles and builds the WSP package– Deploy – compile, package and

deploy the package– Retract – removes the solution

package from server

Page 63: Upgrading customized solutions in SharePoint from 2007 to 2010

Content

• Building a new solution• Upgrading an existing solution

– Upgrading a non-VSeWSS solution– Upgrading a 2005/2008 VSeWSS

solution– Upgrading a WSP package

• Version management

Page 64: Upgrading customized solutions in SharePoint from 2007 to 2010

Upgrading an Existing SolutionUpgrading an existing solution

General upgrading concerns• Old API still around (Microsoft.SharePoint.dll) with minor changes (Dispose SPWeb for

example)• New API (Microsoft.SharePoint.Linq.dll, Microsoft.SharePoint.Client.dll,

Microsoft.SharePoint.Taxonomy.dll )What’s new?

• New technologies available: Silverlight, AJAX, JSON• New UI: Ribbon, pop ups

Important! Tips for safer upgrade• Keep the same namespaces and assembly evidence• Keep elements GUID (Features, List/Site Definitions, Etc.)• Existing web parts – Keep same base class!

Page 65: Upgrading customized solutions in SharePoint from 2007 to 2010

Content

• Building a new solution• Upgrading an existing solution

– Upgrading a non-VSeWSS solution– Upgrading a 2005/2008 VSeWSS

solution– Upgrading a WSP package

• Version management

Page 66: Upgrading customized solutions in SharePoint from 2007 to 2010

Upgrading an Existing SolutionUpgrading a non-VSeWSS solution

• Case study: Upgrading KWizCom SharePoint List Forms Extensions

• What we had in 2007:– controltemplates ASCX files.

(New control templates and updating existing ones*)

– Application settings pages– List settings link– Feature activated, MSI installer– External references to utilities/shared resources

Page 67: Upgrading customized solutions in SharePoint from 2007 to 2010

Upgrading an Existing SolutionUpgrading a non-VSeWSS solution

• SLFE version 1.*.*

Page 68: Upgrading customized solutions in SharePoint from 2007 to 2010

Upgrading an Existing SolutionUpgrading a non-VSeWSS solution

• What we added in 2010:– List settings ribbon buttons– Add CSS file using Delegate– WSP packaging

Page 69: Upgrading customized solutions in SharePoint from 2007 to 2010

SLFE PROJECTLive demo of SLFE in Visual Studio

Page 70: Upgrading customized solutions in SharePoint from 2007 to 2010

Upgrading an Existing SolutionUpgrading a non-VSeWSS solution

• 2010 New UI– Ribbon (resizable)– Using image store files

and CSS class

Page 71: Upgrading customized solutions in SharePoint from 2007 to 2010

SLFE SOLUTIONLive demo of SLFE in SharePoint

Page 72: Upgrading customized solutions in SharePoint from 2007 to 2010

Upgrading an Existing SolutionUpgrading a non-VSeWSS solution

• Conclusion– In order to make the most of VS2010 and

VS2010 extensions for WSS its best to build a new project skeleton and import existing code into it.

– If you already have a WSP package you can use it to build your project skeleton from it (reverse engineer) but your .NET code will not be included!

Page 73: Upgrading customized solutions in SharePoint from 2007 to 2010

Upgrading an Existing SolutionUpgrading a non-VSeWSS solution

Open VS2010 and Create empty project

Build the skeleton of the project

Set namespace and assembly evidence to the same as in your pre-upgrade

Manually import your code to the new project

Steps for upgrading a project

Page 74: Upgrading customized solutions in SharePoint from 2007 to 2010

Content

• Building a new solution• Upgrading an existing solution

– Upgrading a non-VSeWSS solution– Upgrading a 2005/2008 VSeWSS

solution– Upgrading a WSP package

• Version management

Page 75: Upgrading customized solutions in SharePoint from 2007 to 2010

Upgrading an Existing SolutionUpgrading VSeWSS solution

• Unfortunately, you cannot convert VS2005/2008 projects using visual studio alone

• Trying to do so will invoke this error:“The project type is not supported by this installation.”

Page 76: Upgrading customized solutions in SharePoint from 2007 to 2010

Upgrading an Existing SolutionUpgrading VSeWSS solution

• But fear not! VSeWSS 2010 comes with an import tool (VSeWSS 2008 only):

http://code.msdn.microsoft.com/VSeWSSImport

• For all other projects that used WSP for deployment - This next option might be what you are looking for!

Page 77: Upgrading customized solutions in SharePoint from 2007 to 2010

Content

• Building a new solution• Upgrading an existing solution

– Upgrading a non-VSeWSS solution– Upgrading a 2005/2008 VSeWSS

solution– Upgrading a WSP package

• Version management

Page 78: Upgrading customized solutions in SharePoint from 2007 to 2010

Upgrading an Existing SolutionUpgrading a WSP package

• If you have a WSP packaged solution, you can import it into 2010!

Page 79: Upgrading customized solutions in SharePoint from 2007 to 2010

Upgrading an Existing SolutionUpgrading a WSP package

• Import wizard

Your code doesnot get

imported!

Page 80: Upgrading customized solutions in SharePoint from 2007 to 2010

Upgrading an Existing SolutionUpgrading a WSP package

• The import process will build a skeleton for you

• After the import is done, some work is needed

Page 81: Upgrading customized solutions in SharePoint from 2007 to 2010

SLFE SOLUTIONImporting WSP package

Page 82: Upgrading customized solutions in SharePoint from 2007 to 2010

Content

• Building a new solution• Upgrading an existing solution• Version management

– How can I mark versions– Shared resources– Upgrade / downgrade solution version

Page 83: Upgrading customized solutions in SharePoint from 2007 to 2010

Version ManagementVersion management

• Why do we need version management?– Tractability of bugs or changes– Perform upgrade operations on existing installations

(add a field, create hidden list etc.)– Monitor Dev, Staging and production deployment

running code• Not for ISV only!

– In house development team? Get used to working with versioned packages!

Page 84: Upgrading customized solutions in SharePoint from 2007 to 2010

Content

• Building a new solution• Upgrading an existing solution• Version management

– How can I mark versions– Shared resources– Upgrade / downgrade solution version

Page 85: Upgrading customized solutions in SharePoint from 2007 to 2010

Version ManagementHow can I mark versions

Change assembly version and use assembly version redirectionIn package.tepmlate.xml*:

In web.config:

Page 86: Upgrading customized solutions in SharePoint from 2007 to 2010

Version ManagementHow can I mark versions

Currently no supportfor marking package,but you can markfeatures:

Page 87: Upgrading customized solutions in SharePoint from 2007 to 2010

Version ManagementHow can I mark versions

Mark versionnumber in yourcode:

Page 88: Upgrading customized solutions in SharePoint from 2007 to 2010

Content

• Building a new solution• Upgrading an existing solution• Version management

– How can I mark versions– Shared resources– Upgrade / downgrade solution version

Page 89: Upgrading customized solutions in SharePoint from 2007 to 2010

Version ManagementShared resources

• You may need to add shared resources to your projects– Assemblies (utility classes, base classes, 3rd party

components)• Sandbox – no problem• GAC – no version collisions*• BIN deployment – version collisions may occur

– Suggested solution:• Create one shared “Foundation” solution• Use assembly version redirect to support upgrades (must keep

backward compatibility)

Page 90: Upgrading customized solutions in SharePoint from 2007 to 2010

Content

• Building a new solution• Upgrading an existing solution• Version management

– How can I mark versions– Shared resources– Upgrade / downgrade solution version

Page 91: Upgrading customized solutions in SharePoint from 2007 to 2010

Version ManagementUpgrade / downgrade solution version

• Built in support for upgrade operations!• SharePoint will allow mark if feature

requires upgrade• Many upgrade operations supported, and

custom upgrade handlers can be coded

Page 92: Upgrading customized solutions in SharePoint from 2007 to 2010

Version ManagementUpgrade / downgrade solution version

• Upgrading / downgrading is easy!

• Once you deploy several versions of same solution you will be able to upgrade instead of activate!

Page 93: Upgrading customized solutions in SharePoint from 2007 to 2010

Content

• Building a new solution• Upgrading an existing solution• Version management

Page 94: Upgrading customized solutions in SharePoint from 2007 to 2010

Summary

• You now have real-world experience in upgrading components into 2010

• There is a lot more to see

Overall, It’s been a pleasure!

Page 95: Upgrading customized solutions in SharePoint from 2007 to 2010

Contact UsFor more information on SharePoint 2010 or to get

this PPT please don’t hesitate to contact me,• Email: [email protected]• Online: http://www.kwizcom.com• Blog: http://kwizcom.blogspot.com

* Learn * Plan * Deploy * Build *

Call to learn how KWizCom can assist you!

Page 96: Upgrading customized solutions in SharePoint from 2007 to 2010

Learn More about SharePoint 2010

Information forIT Prosat TechNet

http://MSSharePointITPro.com

Information forDevelopers

at MSDNhttp://MSSharePointDeveloper.com

Information forEveryone

http://SharePoint.Microsoft.com

Page 97: Upgrading customized solutions in SharePoint from 2007 to 2010

KWizCom

Leading SharePoint Component Provider


Recommended