Reader Level:
Articles

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

By Vijai Anand on August 07, 2012
In this article you will see how to resolve the error “Error occurred in deployment step 'Activate Features': Key cannot be null. Parameter name: key” in Visual Studio 2010.
  • 0
  • 0
  • 8851


In this article you will see how to resolve the error "Error occurred in deployment step 'Activate Features': Key cannot be null. Parameter name: key" in Visual Studio 2010.

Error

I have created a custom Content Type using Visual Studio 2010. The entire solution looks like the following:

Shr1.jpg

When I try to deploy the solution from Visual Studio 2010 by right-clicking on the solution and then click on Deploy, I was getting the error:

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

Reason

The reason is in the Content Type, the Elements.xml file <FieldRef> tag was closed as </FieldRef> which will be considered as an empty or null element.

Shr2.jpg

How to Resolve

In the Content Type Elements.xml file remove the </FieldRef> element and close the <FieldRef> element as shown below:

Shr3.jpg

Now I was able to deploy the content type successfully from Visual Studio 2010.

Summary

Thus in this article you have seen how to resolve the error "Error occurred in deployment step 'Activate Features': Key cannot be null. Parameter name: key" in Visual Studio 2010.

Vijai Anand

Vijai Anand has been working in IT industry for over 5 years. He holds Bachelor's degree in Electronics and Communication Engineering. Vijai write articles and blogs related to SharePoint 2013, SharePoint 2010, Silv... Read more

COMMENT USING

Trending up