Error occurred in deployment step ‘Recycle IIS Application Pool’: Object reference not set to an instance of an object

When working in TFS environment, sometimes project failed to deploy with error “Error occurred in deployment step ‘Recycle IIS Application Pool’: Object reference not set to an instance of an object“. The issue is the missing “Package” folder in SharePoint project.

Impact of missing “Package” folder

  1. If you have created the custom list using Visual Studio 2012 (or 2013) then the designer of list will not open and it will show the “Schema.xml” file instead.
  2. When deploying the project “Recycle IIS Application Pool’: Object reference not set to an instance of an object” error occurred.

Resolution

  1. Check the files of the SharePoint project.
  2. There is one directory/folder “Package” which must be present. If this directory is missing in the project then open TFS explorer and go to the project directory. Take the latest version of “Package” from TFS.
  3. In Solution Explorer, select the project and click “Show all files” option. Include the “Package” folder in project. Take the latest version again of “Package”.
  4. Once added, build the project and deploy it. The project will be deployed.

Note : If you will get the same error again then close all instances of Visual Studio, do IISRESET and again reopen the Visual Studio and follow the above steps again.

Advertisements

One thought on “Error occurred in deployment step ‘Recycle IIS Application Pool’: Object reference not set to an instance of an object

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s