SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Document Library definition that I added to the solution. I want to include multiple content types for this Document Library: one that inherits from Folder and one that inherits from Document. I did search on Google but found nothing worthy. I also need this to be inside the Visual Studio project. I can add them manually in the interface just fine, but I have to do it each time I deploy the solution.

share|improve this question
up vote 2 down vote accepted

Assuming that you already have the content types defined in your project you can do like below.

In your schema.xml, set the attribute EnableContentTypes to TRUE on <List /> element. Then declare the content types you want to use like below

  <ContentTypeRef ID="0x01Contenttypeid1"></ContentTypeRef>
  <ContentTypeRef ID="0x01Contenttypeid2"></ContentTypeRef>
  <ContentTypeRef ID="0x01Contenttypeid3"></ContentTypeRef>
   <! --List all your fields -->
share|improve this answer
Thanks alot, worked – Dr.Denis McCracleJizz Apr 5 '12 at 19:24

Your Answer


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.