SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This seems to me an uphill task in SharePoint but is it possible to deploy the WSPs via SharePoint features? For instance, if we activate a certain feature then some specific SharePoint solutions (WSPs) should be deployed on SharePoint farm.

share|improve this question
up vote 1 down vote accepted


You need to get a reference to the solution object itself via SPFarm.Solutions.

Once you have the SPSolution object, call Deploy (SPSolution.Deploy()) to deploy it.

SPSolutionCollection (returned by SPFarm.Solutions):

SPSolution Members:

share|improve this answer

This seems to me an unnecessarily confusing way of going about things. If you have a feature that depends on another solution I would recommend creating a solution dependency between the "dependency" solution and the solution that contains the dependent feature. Unfortunately that wasn't available in SP2007, so you may have to do something in your deployment script to achieve the same effect.

I realise this may mean deploying the solution before it is actually needed, but I think this is a small price to pay. If you don't do this there is a good chance that when you attempt to activate the feature it won't work.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.