Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

We have a SharePoint 2007 solution with a custom Field Type. We have now upgraded to 2010 and find when deploying a ContentType with a reference to the custom field type we get the following error when activating the feature:

Enable-SPFeature : Constructor on type 'xxx' not found.
  At sharepoint.ps1:131 char:18
  + Enable-SPFeature <<<<  -Identity $featureName -url $url -force:$force
  + CategoryInfo : InvalidData: (Microsoft.Share...etEnableFeature:SPCmdletEnableFeature)

The FieldTypeClass is in the GAC and correct. It hasn't changed since the upgrade. I tried copying the custom fldtypes_xxx.xml to the 14 hive, but get the same error.

The SafeControl entry exists in the web.config. Any ideas why I might be getting this error?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

It turns out Sharepoint 2007 is pretty relaxed about how you define your content types and field types, but 2010 is not so forgiving.

We had an XML file per content type, and included field type definitions referenced by the content type directly above each in the same file.

Splitting the field type definitions out into a single XML file and removing duplications resolved our issues.

share|improve this answer
    
In my case it was indeed one of two constructors (of SPFieldText) missing. Seems like SP 2007 didn't use it. Adding the constructor fixed the error. –  Heinrich Ulbricht Jun 23 at 12:41
add comment

Your Answer

 
discard

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

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