Question

I created a custom list definition, which works well. When i deploy, the list definition is added, when i retract, the list definition retracts properly.

I also created a list instance from said list definition. When i deploy, the list is added and 3 items are created as directed in the element.xml .

The problem is that when i retract my solution, the list instance is still there, although inaccessible (some kind of native stack crash), each time i redeploy the instance of the list, it recreates 3 more items, so i end up with multiple items instead of just 3.

Something is also very weird. I tried to create a feature inside my project to deploy the said list and the said list definition but it wont work. It gives me a compile time error saying something like "I cant activate that feature, try again".

What's actually weird is that i can deploy it if i add it to another feature that was already inside the project. I checked for the properties and they are exactly the same for both features.

Was it helpful?

Solution

Once I had this problem and my workaround was to create an FeatureEventReceiver for creating the listitems. There you also can delete the list on feature deactivation and the retract leaves no problems.

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