SharePoint Feature Activation - Value Out of Expected Range

I started writing a simple function to create a site column and content type. If I try to activate the function as such, it gives me an error. The value is outside the expected range and nothing more useful. If I remove the ContentType tag, the function is activated just fine and I can see the newly created site column. Any idea what's the error with the ContentType?

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Field
     ID="{345C9562-F0D9-4327-853B-5072E296823A}" 
     Name="Account"
     DisplayName="Account" 
     Type="Text" 
     Group="Accounts">
    </Field>
    <ContentType
     ID="0X010100"
     Name="Account Doc"
     Description="Account Doc"
     Version="0"
     Group="Account Types">
        <FieldRefs>
            <FieldRef 
              ID="{345C9562-F0D9-4327-853B-5072E296823A}"
              Name="Account"
              DisplayName="Account" />
        </FieldRefs>
    </ContentType>
</Elements>

      

+2


source to share


4 answers


It turns out that SharePoint was not happy with the trailing 00 in the ID attribute of the ContentType tag. Changing to 01 fixed the problem, or just added the GUID at the end after that worked as well:



<ContentType
 ID="0x010100C8813FB7C4814B44BA7FD679120EF6F5"
 Name="Account Doc"
 Description="Account Doc"
 Version="0"
 Group="Account Types">
    <FieldRefs>
        <FieldRef 
          ID="{345C9562-F0D9-4327-853B-5072E296823A}"
          Name="Account"
          DisplayName="Account" />
    </FieldRefs>
</ContentType>

      

+3


source


Could this be the capital "X" in your content type id? Built in lowercase, so this might be something to look at.



Are there any hints in the server logs about what SharePoint is looking for but can't find here?

+1


source


I had a similar error message when using the generated GUID where I forgot to remove the dash (for example, using 0x0100042061F1-2366-45d8-A7DE-5B5078E87080 instead of 0x0100042061F1236645d8A7DE5B5078E87080)

For more information on Content Type IDs, see the WSS 3.0 SDK or this MSDN article: http://msdn.microsoft.com/en-us/library/aa543822.aspx

+1


source


In my case, I had a simple issue type based content type with one additional custom field. vsewss deployment is such a hack that it cannot package or deploy the solution. Since this is a simple deployment, I just wrote a batch file with stsadm commands to do it.

Sample batch files for setting functions can be found on the andrew connell MVP page. You just delete and re-create the directory for the feature in the features directory sp (12 hive \ template \ features \) copy the features and manifest files cd to 12 hive \ bin dir stsadm -o activatefeature -filename \ feature.xml -force stsadm -o activatefeature -filename \ feature.xml -url IISReset

It's not over yet. Can't say the same for vsewss or any other package utility from where-when-plex

+1


source







All Articles