Tuesday, May 04, 2010

Retrieve Solution file from SharePoint Farm

Situation :
Developer created .wsp file and installed in SharePoint farm . We need install these solution files to new farm and we have no clue where developer has saved these files.It's not in Visual Source safe too.

Disaster Recovery :
Pull the .wsp from the existing farm using code below :

SPSolutionCollection solutions = SPFarm.Local.Solutions;

foreach (SPSolution solution in solutions)
{
SPPersistedFile wspFile = solution.SolutionFile;
wspFile.SaveAs("c:\\Temp\\Solutions\\" + solution.Name);
}

Make sure directory exists .

Enjoy!

No comments:

Reference Architecture: Building a Cost Optimized, High-Throughput HL7, EDI, and FHIR Processing Pipeline on OCI ( Published in Oracle Blog)

 OCI (Oracle Cloud Infrastructure) provides more than 200 services to build your next enterprise application. Explore the blog to learn how ...