Error occurred in deployment step 'Activate Features': Key cannot be null. Parameter name: key

1 comment
While i am creating the Content Types using the Declarative XML . i got the couple of exception.
the below example is one among them.

Error occurred in deployment step 'Activate Features': Key cannot be null. Parameter name: key

The Reason behind the Exception is while defining the site columns for the content types we have to specify like this.
 <FieldRef ID ="{860deaeb-80cd-4a22-ab0d-31e49b67ac90}"  Name ="SiteCol1" DisplayName ="SiteCol1" Required ="TRUE" />     

<ContentType ID="0x0100da3896467d2d4af085f58a0fa1c22703" Inherits ="TRUE"   Group ="MyCTGrp"    Name ="CT1" Overwrite ="TRUE" Description ="This content type is used for the....">
    <FieldRefs >
      <FieldRef ID ="{860deaeb-80cd-4a22-ab0d-31e49b67ac90}"  Name ="SiteCol1" DisplayName ="SiteCol1" Required ="TRUE" />     
    </FieldRefs>
  </ContentType>

If we defined as  <FieldRef ID ="{860deaeb-80cd-4a22-ab0d-31e49b67ac90}"  Name ="SiteCol1" DisplayName ="SiteCol1" Required ="TRUE" >     </FileRef>.

If we Close like this it will considered as null.

Related Post

1 comment:

  1. while adding Visual webpart into page am getting error as“Key cannot be null. Parameter name: Key ”can anyone help me out how to resolve this error?

    ReplyDelete