Share via


How solution deployment has changed development with SharePoint technologies

Background:

Anyone who is familiar with development & deployment of custom solutions on SharePoint Portal Server 2003 or Windows SharePoint Services will probably agree when I say there are certain areas lacking in the end to end process.

For example, here is a high level generic step by step process that usually happens:

  1. Spec written (some people seem to think this step is optional)
  2. Developer develops code etc... Usually on a stand-alone, single server SharePoint environment. (I personally use a VPC for all development these days)
  3. Developer packages code into an installer if you are lucky
  4. Testing
  5. Hand off to production people who go and install it on the server(s).

This would normally be really easy right? Well, in SharePoint land there are many areas where "things" need to be done during an installation. Some of these are (but not limited to):

  • Assembly deployment. GAC or BIN
  • Web.config changes. Additions to the safe controls list, CAS security policies,
  • Resource files like images,
  • Dwp files
  • Site definitions (list definitions etc...)
  • ...

Depending on how your development team packaged these would depend on how much work you had to do to deploy them.

To make matters worse, depending on your physical SharePoint farm you might need to do install steps on each server. This brought in complexity around what servers had what versions at what time etc... A nightmare if you were managing a large farm with many servers.

How we make this better in MOSS and WSSv3:

In MOSS we have a good solution to all of this called the Solution Framework. Here is a little summary about what this is:

"The Windows SharePoint Services (WSS) solution framework provides a way to bundle together all of the components for extending SharePoint in a new file called a solution file (a CAB-based format with a WSP extension). A solution is a deployable, reusable package that can contain a set of features and site definitions, templates, Web Parts, and assemblies that you can apply to a site, and individually enable or disable." – WSS SDK

Not only this but the Solution Framework takes care of deploying the solution to ALL front end web servers in the farm without the admin having to go to each box to do this manually!

You can:

  • Deploy the Solution package to the farm
  • Retract the Solutions package
  • When a new web server is added, automatically deploy the solution to it
  • Deploy new versions of the Solution

Practical example:

In the system I talked about in "Application Development on MOSS & WSSv3" we are using a Solution package to deploy:

  • A custom Site Definition
  • 6 Feature Definitions (another new MOSS technology) that are:
    • Custom Workflows x2
    • Timer Job
    • Content Type
    • Custom List definition
    • Custom Site Columns definition
  • Web part
    • SafeControls list entry

Note: I won't talk about Features or how to create them; Todd has a good post on that subject here: https://www.sharepointblogs.com/tbaginski/archive/2006/06/02/8062.aspx

[Updated] This means when we want to deploy this solution to a new farm we simply use the STSADM -addsolution -filename <path to solution file here> to upload the solution to the farm.  Once uploaded you can simply to into the "Solution management" section under the "Operations" tab in the Central Administration Site, and deploy that solution.

Once it is uploaded we can then choose to Deploy that solution.

This gives you options on when you want the deployment to take place and to what web applications. (In the shot above I had an assembly being deployed to the GAC, hence the warning)

Although all this will be/is documented in the WSS SDK, I thought I quickly go over how to make a solution file.

Consists of:

  • A CAB file containing
    • A Manifest.xml file
    • All the files for the Features etc... that make up your solution

Below is a cut down sample XML manifest.xml file for the example I used above (highlighted text is comments):

<?xml version="1.0" encoding="utf-8" ?>
<Solution xmlns="https://schemas.microsoft.com/sharepoint/" SolutionId="{79d1a62e-3627-11db-963e-00e08161165f}" ResetWebServer="TRUE">

    <Assemblies>
<Assembly DeploymentTarget="GlobalAssemblyCache" Location="Foo.Sharepoint.Webparts\Foo.SharePoint.WebParts.dll">
<SafeControls>
<SafeControl Assembly="Foo.Sharepoint.Webparts, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=63cce650e8605f5d" Namespace="Foo.Sharepoint.Webparts" TypeName="*"/>
</SafeControls>
</Assembly>
<Assembly DeploymentTarget="GlobalAssemblyCache" Location="Foo.Sharepoint.Timer/Foo.Sharepoint.Timer.dll"/>
</Assemblies>

<FeatureManifests>

        <FeatureManifest Location="Foo.Sharepoint.Timer\Feature.xml"/>

        <FeatureManifest Location="Foo.CustomType\Feature.xml"/>

        <FeatureManifest Location="Foo.FooLibrary\Feature.xml"/>

        <FeatureManifest Location="Foo.Columns\Feature.xml"/>

        <FeatureManifest Location="Foo.Workflow.ProcessFoo\Feature.xml"/>

        <FeatureManifest Location="Foo.Workflow.ProvisionFoo\Feature.xml"/>

    </FeatureManifests>

    <SiteDefinitionManifests>
<SiteDefinitionManifest Location="FOO">
<WebTempFile Location="1033\XML\WEBTEMPFoo.XML"/>
</SiteDefinitionManifest>
</SiteDefinitionManifests>
</Solution>

Then you package this up along with all your Feature files into a CAB file with a ".wsp" extension. In short each feature goes into a sub-dir in the CAB that matches the path you have in the Manifest.xml file.  You can use cabmake.exe to do this, or any other tool you like.

Then you are ready to go and deploy!

Although this is probably a little more work to begin with, your deployment team will thank you for it immensely.

-Chris.

Comments

  • Anonymous
    September 11, 2006
    Great post Chris.

    Is this the recommended way to deploy webparts now? I was going to create an MSI to handle installing to GAC and updating web.config, but this seems to take care of all that already. Would this also enable the webpart in the gallery or does the user still have to manually do that per site?

    Also, what if my Solution Management screen has nothing in it? I don't see the toolbar on my page that is visible in your screenshot? Take a look at this screenshot: http://blogs.vertigosoftware.com/photos/ericc/images/3599/original.aspx

    Thanks.

  • Anonymous
    September 11, 2006
    Hi Eric,

    Sorry i had a mistake in my post.  Please see the [updated] section.  Sorry. Yes, this is the prefered method for deployment of web parts as it has many more capabilities than the web part packaging method of deployment.  The old method will still work however :)

    -Chris.

  • Anonymous
    September 12, 2006
    How do we deploy to the ISAPI folder for web services?? Does this method provide us with a way to deploy web services ??

  • Anonymous
    September 12, 2006
    Hi Adrian,

    Your best bet for deploying web services is to deploy to the _layouts directory.  That is if you want the web service to be like the other web services that are available under each site. e.g. http://server/sites/sitename/_layouts/MyApp/MyWebServices.asmx  I have used this in the past quite a bit.  If you do the above then it is a seperate web application that you are deploying so you will need to go into IISManager and make it a web application under the _Layouts directory.  This means you wont be able to deploy a web service like this with teh solution deployment packages.

    Chris.

  • Anonymous
    September 25, 2006
    This is obsolete after Beta 2 Technical Refresh.
    Check out these blogs instead, package your customisations...

  • Anonymous
    October 08, 2006
    find here How solution deployment has changed development with SharePoint technologies, i really like...

  • Anonymous
    October 13, 2006
    Hi Chris, Here you show us how you deploy dll and safecontrol in web.config but where is your .dwp or .webpart file in your manifest.xml ? I try to deploy a webpart thanks wsp but it doesn't work. Thks for your answer. Regards. Hugo

  • Anonymous
    October 18, 2006
    Hi Hugo, DWP files need to be deployed into the web part gallery of the site collection you want them to show up in.  You can do this using the site siettings page, or you can add the DWP file to your site template & in ONET add it as a file that gets deployed into the web part gallery. -Chris.

  • Anonymous
    October 21, 2006
    No blog do Chris Jonhson, &eacute; feita a introdu&ccedil;&atilde;o &agrave; Solution Framework, a nova

  • Anonymous
    November 11, 2006
    In the first part of this serie on SharePoint Solution Generator I just went through the creation of

  • Anonymous
    November 13, 2006
    Thanks to those of you who partipated in my SharePoint Connection basic and advanced Deployment talks

  • Anonymous
    December 13, 2006
    There have been a bunch of questions lately around Global Deployments. Here are some essential resources

  • Anonymous
    January 14, 2007
    Hi all, I will be posting this as an article as well, with a link available from the front page. That

  • Anonymous
    January 14, 2007
    Architecture, Installation, and Migration · Planning and Architecture for MOSS 2007 (large Whitepaper,

  • Anonymous
    January 28, 2007
    Can anybody here figure me out how to deploy an aspx page to the the TEMPLATELAYOUTS directory via the solution package? Thanks.

  • Anonymous
    January 28, 2007
    Can anybody here figure me out how to deploy an aspx page to the the TEMPLATELAYOUTS directory via the solution package? Thanks.

  • Anonymous
    February 22, 2007
    En me balandant sur le forum SharePoint, je suis tombé sur une personne un peu perdu dans la problématique

  • Anonymous
    March 19, 2007
    Starting from auditing , expiration, ( information management policies ) content types , to the pivot

  • Anonymous
    April 11, 2007
    We have the need to deploy .cab files to the server via our solution deployment. However, when doing so we get an error: "Failed to extract the cab file in the solution." I've traced this down to specifically having a .cab file in the solution. Is there a way to work-around this problem and just have these files deployed as any other files in the solution?

  • Anonymous
    May 17, 2007
    Help!  We have created and deployed a site with a custom list. Users have entered data into the list. Versions of the items (very important) have been created. We now need to make changes to the list (more importantly it's editform, newform, etc)  How do we do this and keep the list data, and the item versions intact on the production server? John

  • Anonymous
    May 17, 2007
    This post describes an issue we were having using the SharePoint PageFieldFilter webpart in combination

  • Anonymous
    June 07, 2007
    How easy is it to replace existing deployed web-parts with say an updated version? Also, what do you recommend i use as test-bed when developing web parts for moss2007?

  • Anonymous
    June 15, 2007
    As promised... SharePoint for Developers poster http://www.microsoft.com/downloads/details.aspx?familyid=771aeb45-9d27-4d1f-acd1-9b950637d64e&amp;displaylang=en

  • Anonymous
    June 15, 2007
    PingBack from http://msdnrss.thecoderblogs.com/2007/06/15/

  • Anonymous
    June 15, 2007
    PingBack from http://msdnrss.thecoderblogs.com/2007/06/15/sharepoint-for-devs-sites-and-templates-resources/

  • Anonymous
    June 27, 2007
    how WSP files are deployed into your sharepoint 2007 farm

  • Anonymous
    July 01, 2007
    PingBack from http://www.virtual-generations.com/2007/07/02/sharepoint-link-love-7-2-2007/

  • Anonymous
    July 27, 2007
    I'm trying to work out if it's possible to use the Solution deployment to deploy a shared DLL to that GAC that is contained in 2 different Solution packages? The deployment itself seams to work just fine for both, but if you retract one of the two solutions, then it removes the shared DLL from the GAC - not good:) Thanks.

  • Anonymous
    August 18, 2007
    PingBack from http://marcellotonarelli.wordpress.com/2007/08/18/collezione-di-links-utili-per-moss-2007/

  • Anonymous
    October 31, 2007
    PingBack from http://www.sharepointed.com/2007/10/31/msdn-team-based-development-in-microsoft-office-sharepoint-server-2007/

  • Anonymous
    October 31, 2007
    PingBack from http://www.sharepointed.com/?p=139

  • Anonymous
    October 31, 2007
    PingBack from http://www.sharepointed.com/2007/10/31/msdn-team-based-development-in-microsoft-office-sharepoint-server-2007-2/

  • Anonymous
    October 31, 2007
    PingBack from http://www.sharepointed.com/2007/10/31/msdn-team-based-development-in-microsoft-office-sharepoint-server-2007-3/

  • Anonymous
    November 23, 2007
    I've had a large number of emails from .NET developers who want more information about SharePoint Development.

  • Anonymous
    November 24, 2007
    PingBack from http://www.stum.de/2007/11/24/sharepoint-link-list-1/

  • Anonymous
    January 28, 2008
    Die Windows SharePoint Services 3.0 Infrastruktur sieht vor, dass SharePoint Erweiterungen (Web Parts,

  • Anonymous
    January 28, 2008
    PingBack from http://msdnrss.thecoderblogs.com/2008/01/28/vereinfachung-des-solution-deployments-in-wss-30-resp-moss-2007/

  • Anonymous
    February 06, 2008
    Yeaah, i love solution deployment !

  • Anonymous
    July 11, 2008
    Initially when I first created a webpart for Sharepoint/WSS, I was kind of confused with the number of

  • Anonymous
    July 15, 2008
    The comment has been removed

  • Anonymous
    March 12, 2009
    PingBack from http://michielh.wordpress.com/2009/03/12/deploying-sharepoint-solutions/

  • Anonymous
    May 31, 2009
    PingBack from http://woodtvstand.info/story.php?id=3859

  • Anonymous
    June 14, 2009
    PingBack from http://cutebirdbaths.info/story.php?id=3473

  • Anonymous
    April 29, 2010
    there is a document that gathers deployment methods for most common types of solutions like webparts, workflows, lists and infopath forms + how to package them with differen tools. maybe it will be useful to someone: http://www.starsoft.com.pl/files/Starsoft%20SharePoint%20Competencies%20Center%20-%20MOSS%202007%20-%20Deployment%20&%20Packaging%20guide.pdf