Karine Bosch’s Blog

On SharePoint

Solution Activation Dependencies in SharePoint 2010


In SharePoint 2007 you could already define feature activation dependencies when the availability of a certain feature was required before you could successfully activate a depending feature. This functionality almost worked perfectly, except that it does not deactivate depending features when a parent feature is deactivated. This has not changed in SharePoint 2010.

But in SharePoint 2010 we now have an additional feature: we can now define solution activation dependencies. It works almost similar as feature activation dependencies.  When you deploy  a solution with an activation dependency, SharePoint will check if this parent solution is already deployed. If not, you will get an error message. SharePoint 2010 will not deploy the parent solution for you. Solution dependencies are checked during deployment, not when adding to the solution store. If you retract a parent solution, SharePoint 2010 will not retract the depending child solutions.

Solution dependencies must be defined in the solution manifest, i.e. the manifest.xml file in your wsp package. If you work with the Visual Studio 2010 tools for SharePoint 2010 you have to:

1. Double click the package element from within Solution Explorer.

Select package in Solution Explorer

2. The Package Designer opens. Unlike the Feature Designer, there is no UI available to define the solution activation dependencies, you have to add it manually to the manifest. At the bottom of the Package Designer you will find the Manifest button. Click it to show the CAML within the manifest.

Package Designer

3. At the bottom of the designer you will see a Edit Options section, which you can expand. You are proposed with an empty <Solution> element. Add a <ActivationDependencies> element, in which you can add one ore more <ActivationDependency> elements. You have to specify at least the ID of the parent solution on which activation depends.

Edit Solution manifest

You can find the ID of the parent solution by opening its Package Designer. While in the Package Designer of the parent solution, you can find the the guid in the Properties window:

Select package in Solution Explorer

4. When you try to deploy the child solution, which in my sample is the web part solution, without having deployed the parent solution containing a number of list definitions, you will get following error message.

Error message

5. The only problem is that it only mentions the solution ID. You can make it more user friendly by adding the SolutionName attribute, which is optional.

Edit solution manifest.xml

The error message changes as follows:

Error message

7. I also tried to add the SolutionTitle as the MSDN reference article describes, but it didn’t change the error message.

Remark: the SolutionName should be identical to the name of the parent solution. It is not important when trying to deploy the child solution when the parent solution is not yet uploaded, but it is checked when the parent solution is already deployed.

Solution dependencies work for both farm solutions and sandboxed solutions, and it should also be possible to add a solution dependency on a farm solution from within a sandboxed solution, but I haven’t checked that.

March 14, 2011 - Posted by | SharePoint 2010, Solution Deployment

5 Comments »

  1. Ha..really great blog. Thanks.

    Comment by Emir | April 14, 2011 | Reply

  2. […] there are solution activation depencies that yuou can define, also blogged by Karine who knew?! Like this:LikeBe the first to like […]

    Pingback by SharePoint 2010 Activation Dependencies « Sean Carter | June 20, 2012 | Reply

  3. Is the tag named “SolutionDependencies” as in text, or “ActivationDependencies” as in pictures?

    Comment by Dragan Panjkov (@panjkov) | January 26, 2014 | Reply

    • Hi Dragan, you’re right, there is a typo in the text, I’ll change it. Thanks for the remark!
      Kind regards,
      Karine

      Comment by Karine Bosch | January 29, 2014 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: