Tips and Tricks for Developing MOSS Applications - PowerPoint PPT Presentation

1 / 41
About This Presentation
Title:

Tips and Tricks for Developing MOSS Applications

Description:

... (web, email) ... Attach VPC to host network adapter. Use NAT. Assign a secondary IP ... how networking is set up on host and vpc. Compile code. Stop IIS ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 42
Provided by: big5
Category:

less

Transcript and Presenter's Notes

Title: Tips and Tricks for Developing MOSS Applications


1
Tips and Tricks for Developing MOSS Applications
  • Alex Holcombe
  • Applied Information Sciences

2
Overview
  • SharePoint to a Developer
  • Development environment
  • Debugging
  • Configuration Management
  • Basic Dos and Donts

3
WSS 3.0 Developer Map
4
ASP.NET Integration
  • Tighter integration with ASP.NET 2.0
  • Shines Through
  • Master Pages
  • Web Parts
  • Custom Provider Model
  • Conceptual Differences
  • Template Model
  • Users can edit pages

ASP.NET 2.0
Windows SharePoint Services v3
5
Extending SharePoint
  • WebParts
  • Event Handlers
  • Custom ASPX Pages
  • Web Services
  • Site Administration functionality
  • Searching
  • Timer Jobs
  • STSADM
  • Workflows
  • Site Columns
  • Field Types
  • Content Types
  • List Definitions
  • Master Pages
  • Site Definitions

6
Things to Keep in Mind
  • SharePoint IS
  • An Application
  • Full of OOTB functionality
  • Deceptively complex
  • Extensible using .NET
  • Written by someone else (not you)
  • SharePoint IS NOT
  • A relational database
  • A replacement for all web-based applications

7
Demo
  • Show example functionality

8
Development Software
  • Microsoft Software
  • Windows Server 2003
  • Visual Studio 2005
  • SQL (Express) and SQL Management Tools
  • .NET 3.0 Framework
  • ECM Starter Kit
  • Visual Studio extensions for WF
  • Visual Studio extensions for WSS
  • Other
  • Reflector
  • Text searching tool

9
Environment Considerations
  • Several basic requirements for devs
  • Source Control Access
  • Baseline to clean environment
  • Backup and restore process
  • Consistent baseline across all developers
  • Software upgrade management
  • External Access (web, email)

10
Supported Environment
  • The supported approach for setting up your Web
    Part development environment is to develop
    locally on an Office SharePoint Server 2007
    server.
  • Getting Started with Custom Enterprise Search Web
    Parts (http//msdn2.microsoft.com/en-us/library/ms
    564508.aspx)

11
Environment Options
12
Sample EnvironmentWindows 2003 Workstations
Dev 2 192.168.1.12
Dev 3 192.168.1.13
Dev 1 192.168.1.11
Dev Machines Win 2k3 MOSS SQL Express Dev tools
DC, Source Control, etc 192.168.1.1n
13
Sample EnvironmentXP Workstations running VPC
Dev 2 192.168.1.12 (host) 192.168.1.102 (vpc)
Dev 3 192.168.1.13 (host) 192.168.1.103 (vpc)
Dev 1 192.168.1.11 (host) 192.168.1.101 (vpc)
VPC Win 2k3 MOSS SQL Express Dev tools
Dev Host Win XP
DC, Source Control, etc 192.168.1.1n
14
Networking VPCs
  • No network connectivity
  • Makes network admins happy
  • Difficult to connect to source control
  • Attach VPC to host network adapter
  • Use NAT
  • Assign a secondary IP address to the VPC
  • Attach VPC to host loopback adapter
  • Install loopback adapter on host
  • Allow VPC to access internet through ICS

15
Working with Virtual PCs
  • Install only what you need
  • Keep the .vhd as small as possible
  • Run from an external disk or separate partition
  • Allocate as much RAM as possible
  • Shut down unnecessary apps on the host
  • Access the VPC through RDC
  • Regularly defrag host and VPC
  • Use Compact utility

16
Demo
  • Show how networking is set up on host and vpc

17
Debugging Code
  • Compile code
  • Stop IIS
  • Deploy assembly
  • Start IIS
  • Set breakpoint in code
  • Initialize a SharePoint page
  • Attach to all w3wp.exe processes

18
Debugging Code
  • HELP - It didnt work!!!
  • Code is different or didnt compile
  • New Assembly didnt get picked up
  • Didnt get GACd
  • IIS not reset
  • Feature not properly installed or activated
  • Code isnt being executed

19
Debugging JavaScript
  • Enable Script Debugging in IE
  • Attach to IE.exe process
  • Open Running Documents window in VS
  • (Ctrl-Alt-N)
  • Set breakpoint
  • Open page/click to execute

20
SharePoint Logs
  • Located in 12\LOGS
  • Turn up logging in SharePoint
  • From Central Administration
  • Operations \ Diagnostic Logging \ Event
    Throttling
  • Select a Category All
  • Least Criticalevent log Information
  • Least Criticaltrace log Verbose
  • Use a good text editor to search through the logs

21
IIS Error Messages
  • Turn on logging in IIS
  • Open web.config in the web app root
  • Modify the following
  • ltconfigurationgt
  • ltSharePointgt
  • ltSafeModegt
  • set Callstack "true"
  • ltconfigurationgt
  • ltsystem.webgt
  • ltcustomErrorsgt
  • set mode"Off".
  • ltcompilationgt
  • set debug"true".

22
Demo
  • Attach to w3wp process
  • Attach to IE process
  • Increase logging level in SharePoint

23
Working With The 12 Hive
  • Usual location
  • C\program files\common files\microsoft
    shared\web server extensions\12
  • NEVER modify any OOTB files
  • Create a script which copies/updates your files
    in the 12 hive
  • Understand the consequences of modifying the
    files you created

24
Commonly Used Folders
  • List of folders in the 12 hive that are commonly
    used by developers (not comprehensive)
  • 12
  • CONFIG stsadm commands, security trust files
  • LOGS SharePoint log files
  • Resources - .resx files
  • TEMPLATE
  • CONTROLTEMPLATES .ascx files
  • FEATURES Feature files
  • LAYOUTS .aspx files
  • SiteTemplates Site Definition files
  • XML Field Type definitions

25
Finding Examples
  • Search the web
  • MSDN
  • Google Groups
  • Blogs
  • Is this being done OOTB?
  • Search the 12 hive
  • Search using Reflector

26
Valuable 12 Hive Information
  • The 12 Hive is a valuable resource for
    information
  • Use it to see how things are being done OOTB
  • SharePoint functionality is deployed as Features

27
Example Locations of Interest
  • CONTROLTEMPLATES
  • DefaultTemplates.ascx Rendering field templates
  • Features
  • Ctypes OOTB Content type definitions
  • CustomList Custom List definition
  • Fields OOTB field definitions
  • SiteTemplates
  • Sts OOTB Teamsite site definition
  • This is a small subset of what is there

28
Demo
  • Find information in 12 hive
  • Search for examples of OOTB functionality

29
Configuration Management
  • Multiple ways to create things
  • UI
  • XML
  • Code
  • Can be problematic for a developer
  • Each has its own pros and cons
  • They are NOT equal
  • Must understand the impact of each
  • How do you manage changes / source control
  • How is it deployed
  • How is it maintained

30
Site Definitions and Templates
  • Site templates
  • CAB package of differences from site definition
  • Stored in content database
  • End-user created
  • Site definitions
  • Core description of what a site is
  • Installed to web front ends
  • Developer created
  • Done through xml files
  • Can be extended with code

31
The Feature Framework
  • Modular provisioning Features!
  • Less XML to create site templates
  • Less duplication
  • Reusable pieces of customization
  • Group logical elements intoscenario-driven
    features
  • Easier to add functionality to existing sites
  • Easier to change site functions over time
  • Admins can turn features on/off

32
Solution Deployment
  • Developer packages a custom Web application into
    a solution
  • Admin deploys
  • Files go to all Web front-end servers
  • Can deploy to application servers
  • Solutions can contain
  • Feature definitions
  • Site definitions
  • Template pages and resources
  • Resources
  • Global, bin assemblies

33
Configuration Management
  • Basic rules for CM
  • Source control everything
  • Stage deployable files
  • Automate deployment for staged files
  • Use what works best for you, but automate it
  • Batch files
  • Nant / MSBuild
  • MSI file

34
Deploying to the bin vs. GAC
  • Dont assume you will be able to deploy to the
    GAC on the production servers

35
Deployment Steps
  • Stop IIS
  • Deactivate existing feature
  • Uninstall existing feature
  • Delete existing files
  • Remove existing assembly
  • Register new assembly
  • Copy new files
  • Install new feature
  • Activate new feature
  • Start IIS

36
Deployment Options
  • Using STSADM
  • Easy to script out with batch files
  • Initializes on each call
  • Can be time consuming
  • Using OM
  • Initializes once
  • Very fast
  • Useful when deploying large number of features

37
Demo
  • Show sample batch file
  • Show sample Nant script
  • Show code to install with OM

38
Basic Don'ts
  • Dont modify any existing files
  • Dont assume your assembly will go in the GAC
  • Dont run everything as an administrator
  • Dont manually copy any files
  • Dont modify or directly access the Database
  • Dont assume the server is localhost

39
Basic Dos
  • Try to use as much OOTB functionality as possible
  • Put everything under source control
  • Automate the deployment process
  • KISS when trying something new
  • Dont assume youve done anything correctly
  • Check the basic things first
  • Try it through the UI (if possible)

40
Things to Keep in Mind
  • SharePoint IS
  • An Application
  • Full of OOTB functionality
  • Deceptively complex
  • Written by someone else
  • Extensible using .NET
  • SharePoint IS NOT
  • A relational database
  • A replacement for all web-based applications

41
Contact Information
  • Alex Holcombe
  • Applied Information Sciences
  • Alex.holcombe_at_appliedis.com
Write a Comment
User Comments (0)
About PowerShow.com