SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have built a WSP in Visual Studio 2010 for my Sharepoint 2010 portal. In VS I have created some custom lists, fields, content types and views. When I deploy it I see some custom lists, fields, content types and views. When I retract my WSP these custom lists, fields, content types and views stay exist. Why they are not removed by the retracting powershell command?

Uninstall-SPSolution -Identity my.wsp -allwebapplications
Remove-SPSolution -identity my.wsp -force

I see in the site collection features the features still activated. Also in the site features. Is this the problem?

share|improve this question
up vote 1 down vote accepted

You've hit the answer yourself. Be sure to deactivate any features before uninstalling/removing the solution. There are very few cases where it is appropriate to uninstall a solution before you've deactivated the feature. Be warned that if you uninstall the solution first you may not be able to deactivate the feature gracefully later.

Another possible reason this issue could occur is if you are creating your Lists/Content Types/Site Columns within a Feature Receiver (inside FeatureActivated for example) rather than using declarative XML. If you do, then you must ensure there is also a method that cleans up after the feature if appropriate inside the Feature Receiver (inside FeatureDeactivating for example).

share|improve this answer

Your Answer


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.