Overwriting Fields/Content Types in Elements.xml

Overwriting Fields/Content Types in Elements.xml

I only spotted this the other day – the Elements.xml contains an ‘Overwrite’ attribute. I was provisioning a custom Content Type and some Site Columns but when activating the feature it failed. The error message was that the Content Type already existed in the site – see screenshot below.

 

Feature Activation Error

It turns out you can set the Overwrite attribute to TRUE to force overwrite of the Content Type – this means when you activate your feature again it will work. Kind of obvious really I just hadn’t spotted it before!

Hope this helps someone!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">