Thursday, October 21, 2010

$Resources:DataSourceContentTypeName Error

After upgrading my SharePoint 2007 farm to 2010, when attempting to create  new site using a custom site template I received the error: "The content type name '$Resources:DataSourceContentTypeName;' cannot contain: " as shown below.


After many hours spent attempting to decipher log file entries, Googling, and researching, I zeroed in on the fact that I had a Reporting Services content type that seemed to have been corrupted in the upgrade process.

In 2010, the content type displayed as:


In 2007, the content type displayed correctly:


What was happening is that when I attempted to create the new site with the custom template, it was attempting to activate the corrupt content type. The solution to this issue is to simply delete and recreate the corrupt content type; but this is easier said than done.

Here is the process I used to resolve the issue.

Before a Content Type can be deleted, you must first remove it from every place it is being used. I found the easiest way to identify content type usage is to use the excellent tool SharePoint 2010 manager. This is a truly excellent tool. I was able to identify every place the offending content type was used quickly and easily, and remove it.

Once the content type was no longer being used, I was still unable to delete the content type. I would receive an error stating that the content type was "part of a feature" and could not be deleted.

The next step was to uninstall the feature, which I determined to be the "ReportServer" feature. Here's where it gets tricky. You must do things in the correct order to resolve the issue. The steps, and the order to perform them are:

  • stsadm.exe -o deactivatefeature 
  • stsadm.exe -o uninstallfeature -force 
  • stsadm.exe -o execadmsvcjobs 
  • stsadm.exe -o installfeature
  • stsadm.exe -o activatefeature
This will properly deactivate, uninstall, reinstall and activate the feature. Once this process is complete, your content types should display correctly, and not as $Resources:........

At this point you've cleaned up the corrupt content type. However, you still cannot create a new site with your custom template because the previously created template still references the old corrupt content types. You need to now create a new site template. The new template will be clean, and there will be no trace of the corrupt content types.

You can now create a site with the template.

1 comment:

  1. After doing all the steps suggested above, the feature is reinstalled and activated successfully. I now have the Report Server content types showing up in the list instead of [$Resources...], but my original problem (creating a new site using a template) is still there. Any suggestions or thoughts on this?

    Thanks.

    ReplyDelete