I have a feature in which I have a custom ListDefinition. Within the definition, I also have a ListInstance based off of the definition. When installing and activating the feature, these lists are provisioned in the site as expected.
When I retract my solution from the farm, these lists still exist, but throw said error that they cannot find the custom ListDefinition of which they are based on.
What is the best approach to handling this issue? I would like to do one of two things:
1) Delete the lists upon uninstallation (thought the feature receiver is not scoped to the individual site, but at the farm)
Edit - Clarification
The FeatureUninstalling event is run by the SharePoint timer job. It retracts the solution from the farm, wherever it may be installed. For that reason,
null. The event has access to
SPFarm.Local, but there is nothing in that class to get what I need.
2) Somehow allow the lists to continue to function (read only?) when the feature is uninstalled.