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 this feature that I am trying to run in order to configure a site, this feature among other things creates pages based on content types, etc. The problem I am facing is that everytime i am trying to enable the feature from code the site content type collection is allways empty. I have tried:

  • Include feature in a custom site definition
  • Feature stapling to a OOB site
  • WebProvisioned event
  • WebProvisionProvider provision method
  • Tried a Poling thread to keep checking ContentType collection count every 500ms - this throws an exception after some runs - SPException

If I do: web.ContentTypes.Count it allays returns zero even when web.Provisioned=true.

If I enable my feature manually all the content types are there as expected.

How do I go about solving this problem? Any ideas?


share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.