Skip to main content

Importance of Solution Packages

SharePoint deployments vary in size from a stand-alone installation on a single server to large multi-server farms. A solution or feature may require configuration changes to the web application, placing files on the file system, and/or deploying assemblies. As such, manual deployments can be administratively difficult since the possibility of deployment error increases with the number of servers in the farm as features and solutions are moved from a development environment to a test environment and finally to a production environment. In order to reduce deployment complexity and possibility of error, SharePoint uses solution packages a deployment mechanism to ensure consistent deployment of solutions and features to all servers in the farm. This allows the testing of a deployment and enables system administrators to create scripted installations (a typical requirement in most enterprise-class IT organizations).

Anatomy of a Solution Package

A solution package is a compressed CAB file with a WSP (.wsp) extension that contains the contents to be deployed including its required additional meta data.
The contents inside the WSP file may include, but is not limited to, assemblies, aspx files, feature manifests, schema XML files, site definitions, WEBPART files, DWP files, InfoPath forms, resource files, images, javascript files, other media files, html files, XML files and the solution manifest. In other words, it can contain just about any type of file you can think of. I may go into details of some of the SharePoint specific content files in some future post.
Every solution package requires additional meta-data to provide the WSS run time with instructions on what to do with the content of the WSP file. The meta-data is stored in a manifest file in XML that must be located in the root of the WSP file; the file is appropriately named manifest.xml. Perhaps I will dive into the details of the Solution schema that defines the XML structure of the solution manifest in another post in the future.

How Solution Packages Work

Basically, they just do.
But in all seriousness, the deployment of a solution package happens in two stages. In the first stage, or the installation stage, WSS takes the WSP file and copies it to the configuration database. In the second stage, or the deployment stage, WSS takes the WSP file from the configuration database, extracts the content(s), and places the content(s) as specified in the package meta-data. Simple huh? Obviously, a system administrator needs to tell WSS to install and deploy a package. This is easily accomplished by executing three simple STSADM utility commands.
stsadm -o addsolution -filename my.wsp
stsadm -o execadmsvcjobs
stsadm -o deploysolution -name my.wsp
The addsolution and deploysolution operations both take additional operational parameters that may be needed depending on the needs of actual solution to be deployed. It should be noted that the  STSADM utility commands only need to be executed on the server that is hosting the Central Administration application. Let’s look at what each command actually does:
  1. The first line (stsadm -o addsolution -filename my.wsp)creates a timer job that asynchronously performs the installation stage of the solution deployment. When the job executes, WSS takes the specified WSP file and copies it to the configuration database.
  2. The second line (stsadm -o execadmsvcjobs) forces WSS to execute any timer jobs that are pending. This is necessary because the actual deployment stage cannot commence until the installation stage has been completed successfully.
  3. The last line (stsadm -o deploysolution -name my.wsp) creates another timer job that asynchronously performs the actual deployment stage of the solution deployment. When the timer job executes, WSS gets the WSP file from the configuration database and deploys the contents of the package based on the instructions defined in the solution package meta-data. It should be noted that the WSS service on each server in the farm performs this task at the same time as triggered by the timer job ensuring a consistent and timely deployment on all servers in the farm.
Another great thing about the solution deployment mechanism is that it also simplifies the removal of a solution from a farm. Solution removal also happens in two stages. In the first stage, or retraction stage, WSS uses the solution package meta-data to remove the contents from each server in the farms. In the second and final stage, or deletion stage, WSS deletes the copy of WSP file from the configuration database. A system administrator can accomplish this easily be executing three STSADM utility commands on the server hosting the Central Administration application.
stsadm -o retractsolution -name my.wsp
stsadm -o execadmsvcjobs
stsadm -o deletesolution -name my.wsp
The retractsolution and deletesolution operations both take additional operational parameters that may be needed depending on the needs of actual solution to be removed. Like we did with the deployment commands, let’s now review what each command actually does:
  1. The first line (stsadm -o retractsolution -name my.wsp) creates a timer job that asynchronously tells the WSS service on each server in the farm to go get the WSP file from the configuration database, take a look at the solution package meta-data, and retract any features, files, and/or assemblies that were previously deployed. This command initiates the retraction stage of the removal process.
  2. The second line (stsadm -o execadmsvcjobs) forces WSS to execute any timer jobs that are pending. This is necessary because the actual deletion stage cannot commence until the retraction stage has been completed successfully.
  3. The last line (stsadm -o deletesolution -name my.wsp) creates another timer job that asynchronously performs the deletion stage of the solution removal. This job tells the WSS run-time to delete the copy of WSP file from the configuration database.
And that is how solution packages work.

Creating a Solution Package

While SharePoint elegantly utilizes Microsoft’s most advanced bleeding edge technology (such as SQL Server, the .NET 3.5 framework, etc.), the actual process of creating a WSP file is ironically a bit archaic. If you are using Visual Studio 2005 for development, then the Visual Studio 2005 extensions for WSS 3.0 can jump start the process of creating the WSP file (but it won’t save you as much time as I expected it to when I first used the extensions). The process of creating a WSP file is the same as creating a  CAB file using the MAKECAB operating system utility. The MAKECAB utility creates the WSP file by reading and processing the cabinet definition contained in a DDF file, also known as the Data Description File. Creating a DDF file is not difficult and can be done with any plain text editor, but the maintenance of the DDF file is manual (this is why I called the process a bit archaic) and become quite tedious with large solutions.In any case, let’s build a sample solution package.
The first step is to create the data description file (DDF) that describes the files for the CAB archive. You can use any text editor to create the file.
; ** my.wsp **
.OPTION EXPLICIT                   ; Generate Errors
.Set CabinetNameTemplate=my.wsp
.Set DiskDirectoryTemplate=CDROM   ; All cabinets go in a single directory
.Set CompressionType=MSZIP         ; All files are compressed in cabinet files
.Set UniqueFiles="ON"
.Set Cabitet=on
.Set DiskDirectory1=Package
; All solution packages require additional metadata
manifest.xml   manifest.xml
; Deployment files, Schemas, and Assemblies
my.html        LAYOUTS/mysample/my.html
There are lot of things going on in the DDF file, but here is what I think is important to understand.
  • Comments in the file begin with a semi-colon
  • .OPTION lines tell the MAKECAB utility what options to use when building the CAB archive
  • .Set lines tell the MAKECAB utility what values to apply to certain parameters that are used when building the CAB archive
    • Make sure the CabinetNameTemplate parameter is set to what the name of the WSP file will be (in the example above the MAKECAB utility will generate a CAB archive named my.wsp)
  • Each content file to be added to the CAB archive is listed on a line in a space separated source-destination format
    • For example, this CAB archive will contain an HTML file (my.html); the last line in the example above tells the MAKECAB utility to grab the my.html file from the file system (the source location) and place copy it to LAYOUTS/mysample/my.html in the CAB archive (the destination location)
    • Double quotes can be used to define sources that contain spaces in the path or file name
    • Make sure to include the solution meta-data XML file (manifest.xml) at the root of the CAB archive
The next step is to create the solution manifest file .
<Solution SolutionId="01234567-89AB-CDEF-0123-456789ABCDEF"
  xmlns="http://schemas.microsoft.com/sharepoint/">
  <TemplateFiles>
    <TemplateFile Location="LAYOUTS/mysample/my.html" />
  </TemplateFiles>
</Solution> 
The example is a very simple solution manifest, but there are a couple of things to take away from it.
  • Every solution has a GUID (globally unique identifier) that identifies uniquely
  • As a general rule, every deployment file, schema, and/or assembly contained in the CAB archive must also be listed in the solution manifest or another manifest listed in the manifest.xmlfile; otherwise it will be ignored by the WSS runtime
  • The locations of the deployment file, schema, and/or assembly in the manifest refer to the location in the CAB archive
The last step is to use the MAKECAB utility to generate the solution package – the actual WSP file . This is done by using a command window and executing a simple command:
makecab /f my.ddf
And that’s how a solution package (WSP file) is created.

Comments

  1. I'm amazed, I have to admit. Seldom do I come across a blog that's both equally
    educative and engaging, and without a doubt, you've hit the nail on the head. The problem is an issue that not enough folks are speaking intelligently about. I'm very happy
    that I came across this during my hunt for something regarding this.


    Stop by my blog post: wordpress seminar

    ReplyDelete
  2. I was wondering if you ever considered changing the structure of your website?
    Its very well written; I love what youve got to say. But maybe you could a little more in
    the way of content so people could connect with it better.
    Youve got an awful lot of text for only having one or two images.
    Maybe you could space it out better?

    Take a look at my webpage - kur zum abnehmen
    Also see my site > fettkiller diät

    ReplyDelete
  3. I am regular visitor, how are you everybody?
    This post posted at this web site is actually pleasant.

    Also visit my blog: paleo rezepte frühstück

    ReplyDelete
  4. Wonderful website. Lots of helpful info
    here. I'm sending it to a few friends ans additionally sharing in delicious. And certainly, thank you for your sweat!

    my web-site :: ernährung

    ReplyDelete
  5. If some one needs expert view regarding blogging and site-building
    then i suggest him/her to visit this weblog, Keep up the fastidious work.


    Also visit my web page ... Was ist das ausgezeichnete an der glutenfreie Diät

    ReplyDelete
  6. Hello! Do you know if they make any plugins to protect against hackers?
    I'm kinda paranoid about losing everything I've worked
    hard on. Any tips?

    My web page ... tipps blog wordpress

    ReplyDelete
  7. Hello there! This is my 1st comment here so
    I just wanted to give a quick shout out and tell you
    I genuinely enjoy reading your articles. Can you suggest any other
    blogs/websites/forums that cover the same subjects?
    Many thanks!

    my blog post; logi methode pyramide

    ReplyDelete
  8. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.
    You clearly know what youre talking about, why throw away your intelligence on just posting videos to
    your site when you could be giving us something informative to read?



    my blog post; paleo rezepte mittagessen

    ReplyDelete
  9. Hi, I do think this is an excellent web site. I stumbledupon
    it ;) I am going to come back once again since I saved as a favorite it.
    Money and freedom is the best way to change, may you be rich and continue to help others.


    Also visit my website - internet marketing websites
    my page: bauchfett

    ReplyDelete
  10. Hi mates, its fantastic post regarding educationand completely defined, keep it up all the time.


    my site ... low carb sport

    ReplyDelete
  11. Hi mates, its fantastic post regarding educationand completely defined, keep it up all the time.


    Check out my website: low carb sport
    my page - aktins diet

    ReplyDelete
  12. This is a topic that's near to my heart... Best wishes! Where are your contact details though?

    Feel free to surf to my weblog ... glutenfreie Diät

    ReplyDelete
  13. Hello! I know this is kind of off topic but I was
    wondering which blog platform are you using for this website?

    I'm getting sick and tired of Wordpress because I've had problems with hackers and I'm looking at alternatives for another platform. I would be awesome if you could point me in the direction of a good platform.

    Visit my web site - Wellness

    ReplyDelete
  14. I've been exploring for a bit for any high-quality articles or weblog posts in this kind of space . Exploring in Yahoo I eventually stumbled upon this site. Studying this info So i am happy to express that I have a very excellent uncanny feeling I came upon exactly what I needed. I such a lot unquestionably will make certain to don?t overlook this web site and provides it a glance regularly.

    Look into my blog post Aromatherapie
    Also see my web site - Ruecken Massage

    ReplyDelete
  15. What's up, yup this paragraph is genuinely nice and I have learned lot of things from it concerning blogging. thanks.

    Feel free to surf to my web-site ... steuerberatung mainz

    ReplyDelete
  16. Hi there mates, pleasant paragraph and good arguments commented here, I am genuinely
    enjoying by these.

    Feel free to surf to my site sicher geld investieren
    Also see my web site - vergleich betriebliche altersvorsorge

    ReplyDelete
  17. Thank you, I've just been looking for information about this subject for a while and yours is the best I have came upon till now. However, what concerning the conclusion? Are you sure concerning the supply?

    Also visit my web page ... steinzeit diät kartoffeln

    ReplyDelete
  18. That is a great tip particularly to those new to
    the blogosphere. Simple but very precise info… Thanks for sharing
    this one. A must read article!

    Also visit my web page :: wordpress tutorials

    ReplyDelete
  19. Hi there! I just wanted to ask if you ever
    have any trouble with hackers? My last blog (wordpress) was hacked and I ended up losing months
    of hard work due to no data backup. Do you have any solutions to stop hackers?


    Here is my web blog - adkins low carb diet
    My website - quick diets

    ReplyDelete
  20. Hey There. I found your blog using msn. This is an
    extremely well written article. I will be sure to bookmark it and return
    to read more of your useful information. Thanks for the
    post. I will definitely comeback.

    Feel free to surf to my web page: frühstück steinzeitdiät

    ReplyDelete
  21. I’m not that much of a online reader to be honest but your blogs
    really nice, keep it up! I'll go ahead and bookmark your website to come back in the future. All the best

    Feel free to visit my page; blog vorlagen
    my web page - schlechte erfahrung mit vodafone

    ReplyDelete
  22. Every weekend i used to visit this website, for the reason that i
    want enjoyment, for the reason that this this website
    conations in fact fastidious funny information too.

    Here is my page :: bilanzbuchhalter voraussetzungen
    Also see my webpage :: arbeitszimmer absetzen

    ReplyDelete
  23. Thanks to my father who informed me concerning this website, this weblog is actually amazing.


    my page: paläo ernährung

    ReplyDelete
  24. If you desire to take a great deal from this article then
    you have to apply these techniques to your won web site.


    Here is my weblog :: paraflex
    My site - lenkmatte anfänger

    ReplyDelete
  25. I all the time emailed this blog post page to all my contacts, as
    if like to read it next my friends will too.

    Also visit my page; rendite in mainz

    ReplyDelete
  26. Keep on working, great job!

    Take a look at my web page - gluten

    ReplyDelete
  27. Wonderful post however , I was wanting to know if you could write a litte more on this subject?
    I'd be very thankful if you could elaborate a little bit more. Many thanks!

    my website; zöliakie diät

    ReplyDelete
  28. Pretty part of content. I just stumbled upon your
    site and in accession capital to assert that I get actually enjoyed account your weblog posts.
    Anyway I'll be subscribing for your feeds or even I fulfillment you get entry to constantly rapidly.

    Here is my web blog; meta title länge

    ReplyDelete
  29. Attractive section of content. I simply stumbled upon
    your site and in accession capital to claim that I get in fact enjoyed account your weblog posts.

    Any way I will be subscribing in your feeds or even I fulfillment you get admission
    to constantly quickly.

    my page altersvorsorge privat

    ReplyDelete
  30. Fascinating blog! Is your theme custom made or did you download it from somewhere?
    A design like yours with a few simple tweeks would
    really make my blog stand out. Please let me know where you got your theme.
    Many thanks

    Also visit my blog post ... carbs

    ReplyDelete

Post a Comment

Popular posts from this blog

Tab Control in Asp.Net

Scenerio: I need your help in designing tab control in   asp.net .My requirement is I need a tab control in   asp.net (C#) like  for example goto my computer ,right click c drive and select properties.we get tabs like general,security etc....... like that i need to design one tab control(no need of any rightclick) in my web page and the database table columns should come as tabs and inseide the tab data of that particular column should come.   Example:Employee master tab1:Employee name.........his name in the tab tab2:Age.............his age tab3:Address........his address   Solution:   You can do this using a simple div <style type="text/css"> .tabs         {             position: relative;             height: 20px;             margin: 0;   ...

AI and Microsoft: Revolutionizing Efficiency in Nonprofit Organizations

  How AI and Microsoft Enhance Efficiency in Nonprofit Organizations In today’s fast-paced world, nonprofit organizations face unique challenges—limited resources, increasing demands, and the constant need to do more with less. But what if technology could be the game-changer they need? In my latest research paper,  "How AI and Microsoft Enhance Efficiency in Nonprofit Organizations" , I explore how cutting-edge technologies like Artificial Intelligence (AI) and Microsoft’s innovative tools are revolutionizing the way nonprofits operate. From streamlining administrative tasks to enhancing donor engagement and optimizing resource allocation, AI and Microsoft’s solutions are empowering nonprofits to focus on what truly matters—their mission. This paper dives deep into real-world examples, practical applications, and the transformative potential of these technologies. Whether you’re a nonprofit professional, a tech enthusiast, or simply curious about the intersection of technolo...

Social tagging overview in Sharepoint 2010

A tag is a word or phrase that identifies an individual piece of information according to a set of attributes or criteria. Tags make it easy to find and share information about a specific subject or task. Social tagging helps users categorize information in ways that are meaningful to them. Social tagging can improve the quality of search results by filtering against specific tags, and it can also connect individuals who want to share information with other users who have like interests. This article describes the social tagging features in Microsoft SharePoint Server 2010. This article does not describe how to configure social tagging features. It also does not discuss how to implement social tagging features as part of an overall social media strategy for an enterprise. About using social tagging features Social tagging features help users to share information and to retrieve relevant, high-quality content more efficiently. Such sharing encourages collaboration and b...