0

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

1
  • 1
    are you doing anything in a feature receiver? Commented Jul 28, 2011 at 23:00

2 Answers 2

4

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.

1
  • 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. Commented Jul 29, 2011 at 22:09
0

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

1
  • Isn't this almost exactly what Laurie suggested? Commented Aug 2, 2011 at 12:43

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.