Logo
Lose Weight
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
 
 
Windows Server

SharePoint 2010 : Packaging and Deployment Model - Working with Packages

1/7/2013 3:37:17 PM

What may not be apparent in the projects that we’ve created so far is that when we’re deploying a solution to SharePoint, the artifacts in our Visual Studio project are collated into a package file that is then copied to the server. The SharePoint deployment process then uses the contents of the package to install our customization. We can see this process in action by monitoring the output window in Visual Studio.

So far we’ve been working on a single server development machine, but what happens if a farm includes several servers? How can we deploy our customization to all servers? The answer is, of course, to use a package that can be stored centrally and automatically rolled out to all servers in the farm as part of the installation process. As new servers are added to the farm, centrally stored packages are automatically deployed as required. Furthermore, farm administrators have the ability to deploy and retract packages from the Central Administration console.

Package Structure

SharePoint packages are created as cabinet (CAB) files with a .wsp extension. We can, however, rename a .wsp file, such as myproject.wsp, to myproject.cab and view the contents in Windows Explorer.

Each package file contains many different elements, mostly consisting of XML files and resources such as dynamic link libraries (DLLs), script files, or images. One thing that package files have in common, however, is a manifest.xml file. This file is basically the setup guide for the package and contains a list of the deployable items within the package.

Each solution consists of one or more deployable item. A number of different types of deployable items exist, such as an assembly, a resource file, or a site definition file. However, for the most part, deployable items are defined using feature manifests.

Package Designer

Let’s see how these ideas jibe with our understanding of the Visual Studio project structure.

  1. Create a new blank site named Example 19.

  2. Using Visual Studio, create a new Empty SharePoint Project named Exmaple19, as shown:

  3. In the SharePoint Project Wizard, set the site to use for debugging as the site created in step 1, and then select the Deploy As Farm Solution option.

  4. Choose Project Add New Item. Then in the Add New Item dialog, select Empty Element, as shown. Name the element FirstElement.

Let’s take a look at what’s happened in Visual Studio. We have a Features folder and a Package folder. If we double-click Package.package within the Package folder, we’ll see the package designer shown here:

The package designer gives us a visual tool we can use to modify the manifest.xml for a package file. Click the Manifest button at the bottom of the page to see the underlying manifest.xml file:

<Solution xmlns="http://schemas.microsoft.com/sharepoint/"
          SolutionId="--snipped--" SharePointProductVersion="14.0">
  <Assemblies>
    <Assembly Location="Example19.dll"
              DeploymentTarget="GlobalAssemblyCache" />
  </Assemblies>
  <FeatureManifests>
    <FeatureManifest Location="Example19_Feature1\Feature.xml" />
  </FeatureManifests>
</Solution>

In this manifest are two deployable items: an assembly that will be the build output of our Visual Studio project and a FeatureManifest that points to a Feature.xml file.

Deploying Assemblies

By default, the build output assembly will always be added to the solution file. This means that any code that we add within our project will be compiled and the resultant DLL will be deployed to SharePoint in the solution package. In some situations, however, we may need to add another assembly. By clicking the Advanced button in the Solution Designer, we can either add an assembly or add the compiled output of another project within the solution. Along with adding additional assemblies, we can also add any resource assemblies that should be included.

Adding Safe Controls

SharePoint makes use of a custom page parser to assemble the user interface, and this parser is known as the Safe-Mode Parser. Its primary function is to prevent users from executing code on the server that hasn’t been specifically approved by an administrator. The mechanism by which an administrator approves code for execution is the SafeControl entry, which is ultimately applied as a web.config entry on each front-end server. If our assembly contains user controls or web parts or any other component that can be declaratively added to a page, a SafeControl entry is required. If a user attempts to add a component that does not have a corresponding SafeControl entry, an error will be thrown detailing the absence of the SafeControl entry as the problem.

Other -----------------
- Microsoft Content Management Server Development : Validating the HtmlPlaceholderControl (part 3) - Building the Required HTML Placeholder Validator
- Microsoft Content Management Server Development : Validating the HtmlPlaceholderControl (part 2) - Checking for an Empty HtmlPlaceholderControl
- Microsoft Content Management Server Development : Validating the HtmlPlaceholderControl (part 1) - Retrieving the Current Value of the HtmlPlaceholderControl
- Windows Server 2003 on HP ProLiant Servers : Migration Case Studies (part 3) - Hewlett-Packard Company
- Windows Server 2003 on HP ProLiant Servers : Migration Case Studies (part 2) - Eastman Chemical Company
- Windows Server 2003 on HP ProLiant Servers : Migration Case Studies (part 1) - County Government Office
- System Center Configuration Manager 2007 : Network Design - Troubleshooting Configuration Manager Network Issues (part 2) - Identifying Network Issues Affecting Configuration Manager
- System Center Configuration Manager 2007 : Network Design - Troubleshooting Configuration Manager Network Issues (part 1)
- System Center Configuration Manager 2007 : Network Design - Network Discovery
- Exchange Server 2007 : Deploying a Cluster Continuous Replication Mailbox Cluster (part 2)
- Exchange Server 2007 : Deploying a Cluster Continuous Replication Mailbox Cluster (part 1)
- Microsoft Dynamic AX 2009 : Report Customization (part 2) - Adding Promotional Materials to an Invoice Report
- Microsoft Dynamic AX 2009 : Report Customization (part 1) - Creating Promotional Materials
- Leveraging the SharePoint Workspace : Edit a List Item Using the Edit Form Offline, Create a New List Item Using the New Form Offline, Synchronize Offline Changes to SharePoint
- Leveraging the SharePoint Workspace : Leveraging the SharePoint Workspace, View Your List and Display Form Offline
- BizTalk Server 2009 Operations : Disaster Recovery (part 2)
- BizTalk Server 2009 Operations : Disaster Recovery (part 1) - Configuring the Destination System for Log Shipping
- Windows Server 2008 : Promoting a Domain Controller with dcpromo
- Windows Server 2008 : Retrieving Information About Objects with dsget, Viewing and Modifying AD Permissions with dsacls
- Microsoft Systems Management Server 2003 : NTFS Security
 
 
Popular tags
Active Directory Biztalk Exchange Server Microsoft Access Microsoft Dynamic Microsoft Excel Microsoft LynServer Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Pen and Touch Sharepoint Sql Server Windows Server 2008
Most view of day
- Personalizing and Configuring Windows 7 : Performance Tweaks (part 1) - Making It Boot Faster
- Automating Windows 7 Installation : Capturing an Image Using ImageX
- Migrating to Exchange Server 2007 : Migrating from Exchange 2000 Server or Exchange Server 2003 to Exchange Server 2007 (part 1) - Planning Your Migration
- Windows Phone 8 : Configuring Basic Device Settings - Screen Brightness (part 1) - Automatically Adjusting the Screen Brightness
- Microsoft Excel 2010 : Protecting and Securing a Workbook - Adding a Digital Signature
- Advanced Windows 7 Programming : Working in the Background - ADVANTAGES OF WORKING IN THE BACKGROUND
- Accessing and Using Your Network : Accessing Network Resources
- Microsoft Exchange Server 2013 : Mailbox management - Seeking perfection halts progress (part 2) - Starting EAC
- Using the Windows 7 Libraries : USING THE EXPLORER BROWSER CONTROL (part 2)
- Windows Server 2012 : Provisioning and managing shared storage (part 4) - Provisioning SMB shares - Configuration options for SMB shares, Types of SMB shares
Top 10
- Windows Phone 8 Apps : Camera (part 4) - Adjusting Video Settings, Using the Video Light
- Windows Phone 8 Apps : Camera (part 3) - Using the Front Camera, Activating Video Mode
- Windows Phone 8 Apps : Camera (part 2) - Controlling the Camera’s Flash, Changing the Camera’s Behavior with Lenses
- Windows Phone 8 Apps : Camera (part 1) - Adjusting Photo Settings
- MDT's Client Wizard : Package Properties
- MDT's Client Wizard : Driver Properties
- MDT's Client Wizard : Application Properties
- MDT's Client Wizard : Operating System Properties
- MDT's Client Wizard : Customizing the Deployment Share
- Windows Server 2012 : Software and User Account Control Administration (part 5) - Maintaining application integrity - Configuring run levels
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro