0

SharePoint 2013 on-prem. Farm solution with Web scoped feature that deploys without problems when deploying directly from VisualStudio.

However, when trying to activate the feature in the normal way from Site Settings -> Site Features, activation fails.

After combing through the ULS logs, I see six errors like:

Unable to locate the xml-definition for CType with SPContentTypeId '0x01....etc'

It turns out also that it's really only three content type IDs, the errors occur twice for each ID.

Needless to say, the IDs throwing errors are not in my feature.

After much poking around and digging, I find that the IDs correspond to the following content types:

  • Report Data Source
  • Report Builder Report
  • Report Builder Model

which all have to do with the SQL Reporting features.

Why would activation of my feature trigger SharePoint to look for content types of a feature that I'm not even using?

And more importantly, how can I fix it?

4
  • Checked this ? - blog.kenaro.com/2014/03/24/… Commented Jan 20, 2017 at 7:03
  • Interesting post, but doesn't really address my problem. I do not have those content types as orphaned CTs. They are not present. What is happening is that when I try to activate my feature, SharePoint is looking for the definitions for those CTs (as if it is trying to install them). However I do not reference those CTs or any SP feature that might use them in my feature. Commented Jan 20, 2017 at 15:14
  • Hey Dylan, I'm having the same issue now. Did you ever resolve this? Commented Oct 1, 2017 at 2:40
  • @OrneryWalrus I must have solved it somehow, but I don't remember what I did, sorry... Commented Oct 2, 2017 at 13:13

1 Answer 1

0

"Why would activation of my feature trigger SharePoint to look for content types of a feature that I'm not even using?"

Every time SharePoint code loads SPContentTypeCollection (e.g. SPWeb.ContentTypes), it loops through all of the content types that has been created on the sites. If any of these content types have become corrupted somehow, this error will be added to the logs for each corrupted content type. However, apart from the log entries, the code will silently continue and just leave the broken content types out of the collection (and hence not show up in any SharePoint UI or APIs).

So, it seems that you have these three corrupted content types and that is the reason for the errors in the logs. Your feature is probably doing two separate things related to content types, hence it happens twice.

"And more importantly, how can I fix it?"

To fix the content types mentioned in the error messages, you can run the following in a management shell:

uninstall-spfeature -Identity ReportServer -Force
iisreset
install-spfeature -path ReportServer
iisreset

Reactivation of feature, forced recreation of content types or recreation of site collection may also be required afterwards.

However, fixing these content types are not guaranteed to make the feature working. It is impossible to tell without more information about how the feature activation fails.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.