2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.