SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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 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 every time i am trying to enable the feature from code the site content type collection is always 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?

Thanks

share|improve this question

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.