Your SlideShare is downloading. ×
0
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Deploying Code In SharePoint
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Deploying Code In SharePoint

4,954

Published on

How to deploy code in SharePoint. Given at SharePoint Saturday Kansas City - February 2009

How to deploy code in SharePoint. Given at SharePoint Saturday Kansas City - February 2009

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,954
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
61
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Demo manual deployment. Copy a binary out with a web part and manually copy DLL to the GAC.Demo how to export an existing .webpart definition to build from.
  • Explain the manifest.xml and cab.ddf
  • VSeWSS
  • Demo the use of BDC Tools, the MetaData Model and the Import Process
  • Transcript

    • 1. Deploying Code in SharePoint
      Presenter: Corey Roth
      Senior Consultant
      Stonebridge
      Blog: www.dotnetmafia.com
    • 2. Corey Roth
      Consultant for Stonebridge
      Worked in Consumer Electronics, Travel, Advertising, and Energy industries
      Currently doing MOSS development specializing in Enterprise Search, Workflow, and ECM
      Microsoft Award for Customer Excellence (ACE) Winner
      E-mail: corey.roth@gmail.com
      Blog: www.dotnetmafia.com (mirrored on sharepointblogs.com)
    • 3. Challenges for New Developers
      Learning the API
      Setting up the development environment
      Debugging
    • 4. Deployment
    • 5. 12 Hive
      Location of most key SharePoint files: C:Program FilesCommon Filesmicrosoft sharedWeb Server Extensions12
    • 6. 12 Hive (Continued)
    • 7. Deploying Binaries – Two Options
      GAC Deployment – Not recommended unless absolutely necessary (i.e.: Event Recivers, Timer jobs, Workflows, etc).
      Requires application pool to be reset after every deployment.
      Allows code to execute with full trust
      Acceptable for new developers starting out because it is easier
    • 8. Deploying Binaries – Two Options
      Bin Folder Deployment – Recommended but more complex
      Requires a developer to specify code access security settings or running SharePoint with full trust
      Does not require application pool to be reset
      Recommended approach but more complicated to implement
    • 9. SafeControls
      SharePoint won’t execute a web part or user control unless it knows it is safe
      Declare an assembly and namespace safe in web.config
      SafeControls element
      Can be automated using a solution package (.wsp)
    • 10. Deployment Options
      Manually copy binaries, feature files, pages, and controls to appropriate folders on SharePoint server
      Create a Feature – Would still have to manually copy files
      Create a Solution Package (.wsp) – A cab file that contains a manifest telling SharePoint how to deploy files and what features to install
    • 11. Ghetto Deployment (Manual)
      Manually copy binaries to GAC or bin folder
      Manually upload .webpart files to web part gallery
      Manually copy user controls to CONTROLTEMPLATES folder
      Manually copy features files into FEATURES folder
      Manually copy anything else that you might need to deploy
    • 12. Building and Deploying a Web Part
      Deploys similarly to a user control
      .webpart (or .dwp) file tells SharePoint where to find the web part’s code
      Use a feature to add the web part to the gallery
      Complete instructions at my blog
      http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/22/intro-to-sharepoint-development-how-to-build-and-deploy-a-web-part.aspx
    • 13. Demo
    • 14. Features
      A series of XML files that allow you to make changes to SharePoint
      Located in the TEMPLATEFEATURES folder in the 12 hive
      Changes can include creating lists, pages, content types, site columns, and web parts.
      Can copy files into SharePoint’s virtual file repository but the template files still have to be deployed to the 12 hive first
    • 15. Solution Packages (.wsp files)
      A cab file that can copy binaries, features, pages, and other files to SharePoint.
      Defined by manifest.xml and cab.ddf files
      Created with makecab.exe
      Can copy binaries to bin folder or GAC
      Can apply safe control and code access security settings
      Automatically installs features
      Can also be upgraded and retracted / deleted.
      Can be automated with VSeWSS, WSPBuilder, stsdev, etc.
    • 16. cab.ddf
      Specifies which files to copy into the wsp file.
      You must specify each binary, page, XML or .webpart file you want to be copied in this file
      Syntax for each file is source <space> destination
      The destination specified is the location in the file not the location on the SharePoint server.
    • 17. Manfiest.xml
      Specifies which features to activate and which files to copy into the 12 hive.
      Can deploy SiteTemplates
      Specifies SafeControl settings in web.config
      Configures Code Access Security (CAS) settings
      Paths are relative to the TEMPLATES folder in the 12 hive
      http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/09/04/more-on-manfiest-xml.aspx
    • 18. Manfiest.xml Elements
      FeatureManifests – Specifies feautres to activate
      TemplateFiles – Required for any file that you want copied that is not a binary or feature file
      Assemblies – Required for each binary to be deployed
      DeploymentTarget – WebAppplication or GlobalAssemblyCache
      SafeControls – Adds SafeControl entry to web.config
      CodeAccessSecurity – Applies CAS policies to assembly
    • 19. Deploying your solution (.wsp) file
      Add the solution with stsadm
      stsadm –o addsolution –filename mysolution.wsp
      Deploy the solution with stsadm or Central Admin -> Solution Management
      stsadm –o deplysolution –name mysolution.wsp –immediate –allowGacDeployment –allowCasPolicies
      stsadm –o execadmsvcjobs
      -o upgradesolution – Upgrades an existing solution’s files
      -o retractsolution – Remove the solution from a given site(s)
      -o deletesolution – Removes the solution from the solution store
    • 20. Building a User Control with Visual Studio
      Web Application Project
      Reference Microsoft.SharePoint.dll
      Must be registered as safe for SharePoint to execute
      Typically deployed to bin folder using Code Access Security
      Controls are typically deployed to the CONTROLTEMPLATES folder in the 12 hive.
      _ControlTemplates Virtual Directory
      Complete instructions are on my blog
      http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/11/18/introduction-to-sharepoint-development-deploy-a-user-control-in-sharepoint.aspx
    • 21. Demo
    • 22. Demo
    • 23. References
      Dot Net Mafia Blog
      http://www.dotnetmafia.com
      Visual Studio Extensions for SharePoint (VSeWSS 1.3) CTP
      https://connect.microsoft.com/site/sitehome.aspx?SiteID=428
      STSDev
      http://www.codeplex.com/stsdev
      SharePoint Blogs
      http://www.sharepointblogs.com
      WSPBuilder
      http://www.codeplex.com/wspbuilder
    • 24. Questions?
    • 25. Thanks
      Corey Roth
      coreyroth@gmail.com
      www.dotnetmafia.com

    ×