Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In my solution catalog I have many sandboxed solution uploaded, I need to access the activated sandboxed solution in the Solution catalog.

Am accessing Solution catalog under a site as below

m_spSite.OpenWeb().Lists["Solution Gallery"];

I can then iterate through the list but problem is am not able to cast SPListItem to SPUserSolution hence i could not access the status of the solution.

How can I get the activated solution and its properties

Regards, Jeez

share|improve this question
add comment

1 Answer

Firstly, when using OpenWeb(), make sure you properly dispose of the resulting SPWeb object, or you may leak memory.

Secondly; the list items returned by Lists["Solution Gallery"] aren't the same as the SPUserSolution objects used to get them; you will need to load the SPUserSolution using the SPSite.Solutions property (which returns a SPUserSolutionCollection); and then using the index accessor to pull the required solution by Guid.

share|improve this answer
add comment

Your Answer

 
discard

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.