Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top