1

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?

1

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).

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.