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


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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