There's a sharepoint farm with ~60 solutions. On some not specified time someone can deploy a new /update an existing solution to this farm. Everytime a deployment is successfull I need to remove some items from the Cache.

How can I detect that some deployed some solution to the farm programmatically?

I'm using Sharepoint 2010 Server, C# and Visual Studio 2010. because the Production Environment is hosted by a third-party I have no access to the central administration to activate timer jobs. So It would be very nice if there's another way to solve this issue.

3 Answers 3


Introduce a policy that everyone must announce solution deploymements beforehand. In you case it might be good practice in any case to have a calendar saying who is going to install what and when to prevent conflicts.

  • +1 for the organisational resolution. Most of problems like that can be solved by a shared planning.
    – Steve B
    Feb 10, 2012 at 14:06

When a solution is deployed globally, all SharePoint application pools, including Central Administration’s, are recycled automatically. When a web application targeted solution is deployed or retracted, only the application pools of the targeted web applications are recycled.

So when the application pool recycles, I believe cache will be destroyed and refreshed too.

Also you just don't want how to know if solution was deployed programmatically, but also react immediately when a solution is deployed and AFAIK, there is no event receiver exposed by SharePoint which allows you to plug-in your own code when solution deploys in the farm.


And the actual answer to the question:

SPFarm farm = new SPFarm();
SPSolution solution = farm.Solutions["solutionname.wsp"];

and a few properties to inspect that may be what you're looking for:


and for more details: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spsolution_members.aspx

or just use powershell and pipe your SPSolution object to get-member like i did.

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.