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.

2 Answers 2



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): http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spsolutioncollection_members.aspx

SPSolution Members: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spsolution_members.aspx


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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