Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a content type, a list definition based on the content type and also a list instance.

Lets suppose thats all I have in the project. Its on the dev server, everytime I deploy using vstudio the list ITEMS are gone.

How can I avoid this?

share|improve this question
add comment

2 Answers

up vote 7 down vote accepted

When developing solutions for SharePoint 2010 Visual Studio automaticly resolves conflicts when redeploying a solution.

The conflict resolution for a list-instance is to delete the list and then recreate it on redeployment.

To keep your list, disable automatic conflict resolution. See this blog for images Beware that not resolving conflicts may result in un-updated lists.

If it is a limited set of items you could consider adding them to the list instance definition, so that the items are (re)created when the list is instantiated. And simple example of this van be found on MSDN.

share|improve this answer
1  
Is there no way to update the list without losing data? –  xdumaine Nov 20 '13 at 15:15
    
Deploy the wsp using powershell. –  Aveenav May 19 at 14:20
add comment

You can also make some check for existence of your list in feature receiver while adding list.. If exist - skip list creation.

share|improve this answer
    
How would you do that? How would you prevent declarative list creation from happening? –  Andrey May 22 '13 at 16:41
add comment

Your Answer

 
discard

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.