I am brand new to the Visual Studio 2010 templates for SharePoint, having relied on the WSPBuilder toolkit in the past for all my previous SharePoint work. I created what I thought would be a simple ContentType definition inheriting from Item (0x01) using Visual Studio and this is what I got:
I added two new fields to the FieldRefs element as well as one RemoveFieldRef to remove the title column as it did not really fit my scenario. I published to my SharePoint 2010 development environment and was bothered that my Title column was not removed. Here was what I published that did not immediately work:
After spending more time that I would expect to remove the title field, something which I had done many many times, I looked up on MSDN for the ContentType definition to see what I was missing:
What stand out now, is the Inherits="TRUE" section that is new to SharePoint 2010 foundation. If you look at the previous version on the ContentType definition for Windows SharePoint Services 3, you will that Inherits is not there:
Inherits is defined as:
Optional Boolean. The value of this attribute determines whether the content type inherits fields from its parent content type when it is created.
If Inherits is TRUE, the child content type inherits all fields that are in the parent, including fields that users have added.
If Inherits is FALSE or absent and the parent content type is a built-in type, the child content type inherits only the fields that were in the parent content type when SharePoint Foundation was installed. The child content type does not have any fields that users have added to the parent content type.
If Inherits is FALSE or absent and the parent content type was provisioned by a sandboxed solution, the child does not inherit any fields from the parent.
So, to remove the Title field using the RemoveFieldRef element, you must also remove the Inherits attribute entirely (or set Inherits=”False”) in the content type definition:
(Always read MSDN when in doubt!)