Saturday, July 2, 2011

Error occurred in deployment step ‘Recycle IIS Application Pool’: The communication object, System.ServiceModel.InstanceContext, cannot be used for communication because it has been Aborted

When we are developing custom code through Visual Studio 2010 for SharePoint 2010 sites and when we try to deploy the solution then we might see below error.

"Error occurred in deployment step ‘Recycle IIS Application Pool’: The communication object, System.ServiceModel.InstanceContext, cannot be used for communication because it has been Aborted."

When I see this very first time and did not get any clue of what it is looking for and why it is not able to communicate to SharePoint sites. After some time, I though of doing some combinations and all failed in deploying the custom piece to SharePoint.

Solution:
  1. Sometimes when I do rebuild the project and didn't hit "Package" and deploy directly from Visual Studio it successful. 
  2. If it is not successful then the only way is RESTART your visual studio. 
Frustrated? Yes, me too. But there is no way I found.

3 comments:

Khaniya said...

There is a solution to rid of it. You can just restart the "Windows Management Instrument" service. It will definitely resolve your problem.

Khaniya said...

There is a solution to rid of it. You can just restart the "Windows Management Instrument" service. It will definitely resolve your problem.

Praveen said...

Thanks Khaniya.
Next time if I get this error, then will try and post it the result. Thanks for your contribution. Appreciate it.