Answered Where to find the SPFeatureDefinition for SPUserSolution

  • Wednesday, September 21, 2011 6:46 PM
     
     

    All features deployed into SharePoint contain an SPFeatureDefinition object which consists of mostly the feature.xml information.  It appears SPUserSolution does not have information anywhere.

    Looking for an SPUserSolution ReceiverAssembly, but it is nowhere to be found.

    Using ReceiverAssembly to provision objects beyond Sandbox solutions ability, but not possible to display configuration of solution after installed in the Gallery.

Answers

  • Thursday, September 22, 2011 7:37 PM
     
     Answered

    The information can be found using SPUserSolution.SolutionId, but this require iterating through the SPSite.FeatureDefinitions to find a match on SolutionId.

    SPUserSolution spus;

    Guid id = spus.SolutionId;

    foreach(SPFeatureDefinition spfd in SPContext.Current.Site.FeatureDefinitions)

    {

    if (!id.equal(spfd.SolutionId))

    continue;

    //finally have the SPFeatureDefinition object here

    //now if only a way the get the Feature's Title & Description?

    }

     

     

    • Marked As Answer by MULTISY Thursday, September 22, 2011 7:38 PM
    •