Post on 24-Dec-2014
description
Case Study: Upgrading SLFE
from 2007 to 2010Shai Petel (shai@kwizcom.com)VP R&D, Microsoft Certified Trainer
KWizCom Corporation
Content
• Building a new solution• Upgrading an existing solution• Version management
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.
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
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*
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!!!
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).
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
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
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
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
Building a New SolutionCreating a new solution
• Open VS2010
Building a New SolutionCreating a new solution
• Click on new project. Go to:C# -> SharePoint -> 2010 templates
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
Introducing
Your very own sandbox!
Building a New SolutionSetup trust level
• Choose your destiny
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
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
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…
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
Building a New SolutionSetup trust level
• How do I deploy a sandbox solution?
Upload to Solutions gallery
Activate
Building a New SolutionSetup trust level
• Cannot activate solution?
• Go to central administration and make sure windows SharePoint user code service is started
Building a New SolutionSetup trust level
• Sandboxed solution management in Central Admin:
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.
Building a New SolutionSetup trust level
=2B |! 2B ? FullTrust:Sandbox;
Cons Pros
Performance
Resources
Upgrade
Beta friendly
Manageable
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
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
Introducing
Visual Web Part
Building a New SolutionChoose template – Visual web part
• This project template cannot be sandboxed*
Building a New SolutionChoose template – Visual web part
• Install “Visual Studio 2010 SharePoint Power Tools” to create sandboxed visual web part
http://visualstudiogallery.msdn.microsoft.com/en-us/8e602a8c-6714-4549-9e95-f3700344b0d9
Building a New SolutionChoose template – Visual web part
• Project created with all web part files for you
Building a New SolutionChoose template – Visual web part
• A feature will be created for you automatically
Building a New SolutionChoose template – Visual web part
• A package will be created for you automatically
Building a New SolutionChoose template – Event receiver
• This project template can be sandboxed
Building a New SolutionChoose template – Event receiver
“Create project” WizardNew
types of receiver
sNew
events to
handle!
Building a New SolutionChoose template – Event receiver
• Adds all needed files for you
Introducing
Business Connectivity Services
Building a New SolutionChoose template – BCS Model
• This project template can be sandboxed
Building a New SolutionChoose template – BCS Model
• BCS editing tools
Building a New SolutionChoose template – BCS Model
• Packaged and deployed as a farm level feature
Building a New SolutionChoose template – Content type
• This project template can be sandboxed
Building a New SolutionChoose template – Content type
“Create content type”
WizardMore work
needed on the wizard though
…
Building a New SolutionChoose template – List definition
• This project template can be sandboxed
Building a New SolutionChoose template – Content type
“Create List
Def.” Wizard
Building a New SolutionChoose template – Content type
Schema File
Create Elements file for featureOptiona
l: Create
list instance XML
Building a New SolutionChoose template – Content type
• Packaged and deployed as a web feature
Building a New SolutionChoose template – Workflow
• This project template cannot be sandboxed
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
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
Building a New SolutionChoose template – Workflow
• Designer has different options for site and list workflows
Building a New SolutionChoose template – Workflow
• Add sequential workflow, with its own designer
Building a New SolutionChoose template – Workflow
• Creates separate elements file for each workflow
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
Building a New SolutionChoose template – New!
• Server Ribbon project:
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
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!
Building a New SolutionAdding new components
• Add mapped folder
Building a New SolutionAdding new components
• Add other components
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
Building a New SolutionOne-click deploy or package
• Feature and Package editors available
Building a New SolutionOne-click deploy or package
Features and elements can be
shared across your visual studio
solution!
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
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
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!
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
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
Upgrading an Existing SolutionUpgrading a non-VSeWSS solution
• SLFE version 1.*.*
Upgrading an Existing SolutionUpgrading a non-VSeWSS solution
• What we added in 2010:– List settings ribbon buttons– Add CSS file using Delegate– WSP packaging
SLFE PROJECTLive demo of SLFE in Visual Studio
Upgrading an Existing SolutionUpgrading a non-VSeWSS solution
• 2010 New UI– Ribbon (resizable)– Using image store files
and CSS class
SLFE SOLUTIONLive demo of SLFE in SharePoint
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!
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
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
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.”
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!
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
Upgrading an Existing SolutionUpgrading a WSP package
• If you have a WSP packaged solution, you can import it into 2010!
Upgrading an Existing SolutionUpgrading a WSP package
• Import wizard
Your code doesnot get
imported!
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
SLFE SOLUTIONImporting WSP package
Content
• Building a new solution• Upgrading an existing solution• Version management
– How can I mark versions– Shared resources– Upgrade / downgrade solution version
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!
Content
• Building a new solution• Upgrading an existing solution• Version management
– How can I mark versions– Shared resources– Upgrade / downgrade solution version
Version ManagementHow can I mark versions
Change assembly version and use assembly version redirectionIn package.tepmlate.xml*:
In web.config:
Version ManagementHow can I mark versions
Currently no supportfor marking package,but you can markfeatures:
Version ManagementHow can I mark versions
Mark versionnumber in yourcode:
Content
• Building a new solution• Upgrading an existing solution• Version management
– How can I mark versions– Shared resources– Upgrade / downgrade solution version
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)
Content
• Building a new solution• Upgrading an existing solution• Version management
– How can I mark versions– Shared resources– Upgrade / downgrade solution version
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
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!
Content
• Building a new solution• Upgrading an existing solution• Version management
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!
Contact UsFor more information on SharePoint 2010 or to get
this PPT please don’t hesitate to contact me,• Email: shai@kwizcom.com• Online: http://www.kwizcom.com• Blog: http://kwizcom.blogspot.com
* Learn * Plan * Deploy * Build *
Call to learn how KWizCom can assist you!
Learn More about SharePoint 2010
Information forIT Prosat TechNet
http://MSSharePointITPro.com
Information forDevelopers
at MSDNhttp://MSSharePointDeveloper.com
Information forEveryone
http://SharePoint.Microsoft.com
KWizCom
Leading SharePoint Component Provider