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

I am developing a web part and suddenly receive this error when activating it from site settings.

System.InvalidCastException: Unable to cast object of type 'Microsoft.SharePoint.Administration.SPSolution' to type 'Microsoft.SharePoint.Administration.SPFeatureDefinition'.

I cannot get this cleared up even after retracting and removing a number of times. Thanks

share|improve this question
1  
are you doing anything in a feature receiver? –  Rob D'Oria Jul 28 '11 at 23:00
add comment

2 Answers

It sounds like SharePoint is trying to activate your feature using a SolutionID instead of a FeatureID. Make sure you did not use the same guid as both a FeatureID and a SolutionID.

share|improve this answer
    
Those are quite different and have not changed at all. The project has deployed more than once before but now all of a sudden this error. –  ChiliYago Jul 29 '11 at 22:09
add comment
up vote 0 down vote accepted

The problem was that I added the solution ID to the Activation Dependency list instead of the Feature ID.

share|improve this answer
    
Isn't this almost exactly what Laurie suggested? –  SPDoctor Aug 2 '11 at 12:43
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.