views:

217

answers:

1

Howdy,

I am creating a custom ContentType for SharePoint 2007 as a feature scoped to the site collection. When I attempt to activate the feature, I get an error page with only this clue: "Value does not fall within the expected range"

Here are my XML files feature.xml:

<?xml version="1.0" encoding="utf-8"?>
<!--Created by STSDEV at 5/5/2009 5:11:40 PM-->
<Feature
  Id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
  Title="Custom Document Content Type"
  Description="Custom Document Content Type"
  Version="1.0.0.0"
  Scope="Site"
  Hidden="false"
  ImageUrl="CustomDocumentContentType\Image.gif" 
  xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
  <ElementManifests>
    <ElementManifest
      Location="CustomDocumentContentType.xml" />
  </ElementManifests>
</Feature>

and CustomDocumentContentType.xml:

<!--<?xml version="1.0" encoding="utf-8"?>-->
<!--Created by STSDEV at 5/5/2009 5:11:40 PM-->
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
   <ContentType ID="0X010100YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"
               Name="Custom Document Content Type"
               Group ="Custom Document Content Types"
               Description="Custom Document Content Type inherits from Document"
               Version="0">
    <FieldRefs>
    </FieldRefs>
  </ContentType>             
</Elements>

Thank you,
Keith

+2  A: 

I figured this one out.

This line, <ContentType ID="0X010100YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"

Should be <ContentType ID="0x010100YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"

the "X" in the ID should be lowercase.

Keith

Keith Sirmons
Nice work weeding that one out! Those are the types of problems that drive me to pull what's left of my hair out. +1 for your diligence to post your own solution.
Adam McKee