1

I have an SP 2010 Visual Studio 2012/13 solution that creates Site Columns and a document library. The site columns are created correctly since I can see and verify them. The problem I have is with the library I created, which references these site columns, gives me an error when I deploy the solution. If I set the "Deployment Conflict Resolution" of the library to Automatic, everything works fine. If I set the value to None, I get:

Error 33 Error occurred in deployment step 'Activate Features': One or more field types are not installed properly. Go to the list settings page to delete these fields.

If I have data in this library, I don't want it dropped and recreated each time; nothing is being changed. The Site Columns are not being changed so I can't figure out what the problem is. The only other thing I did was to delete the content types that I wasn't using for this library. The feature that the error references has all the site columns as well as the library and a web part.

Any suggestions on how I might be able to get past this?

Thank you

2
  • Have you looked for this issue in ULS Logs? (C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\LOGS)
    – Alexander
    Dec 6, 2013 at 14:39
  • Thank you Alexander. I checked the log and the error was referring to another list. Not the one I thought I was having problems with.
    – DrZ
    Dec 6, 2013 at 18:05

1 Answer 1

1

Seems like you are deploying your List Instance by declaratively (i.e. in elements.xml). I would suggest to switch to a programmatic provisioning of your List Instance, so that you have full control of the behavior if the list already exists.

The steps to programmatically add a list instance would be:

  • Add a Feature Receiver for your provisioning Feature
  • Edit the "Feature Activated" event receiver with code that:
  • If the list doesn't exist, create it
  • If the list already exists, do not delete and recreate
  • You can "selectively" update the list if it already exists, adding/modifying the fields it has, views, etc.

Basically the idea is that you have full control on how the deployment occurs if you switch to a programmatic approach.

Related question: Programmatically creating a list

That being said, if you are sticking with declarative deployment:

  • Are you creating a Content Type that "bundles" the site columns to the list?
  • My recommendation would be:
  • Create a Content Type that inherits from Document
  • Have it include the custom Site Columns that you already created
  • Include the Content Type reference in the List Definition
  • All of this, instead of directly adding the fields to the list, without "wrapping" them in a Content Type

MSDN Reference: http://msdn.microsoft.com/en-us/library/ff728096%28v=office.14%29.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.