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 the 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 doing some trail and error methods and checking Event Viewer, Logs etc... failed in all the ways in deploying the custom piece to SharePoint. Finally, a simple solution worked but didn't find any reason what is the main issue!

Solution:
  1. Sometimes when I do rebuild the project and deploy directly without doing "Package" from Visual Studio it is successful. 
  2. If it is not successful then the only way I see is RESTART your visual studio and deploy.
  3. (From below comments: ) Restarting "Windows Management Instrument" service will work. (I haven't tested).
Frustrated hours come to an end... There is some way always to make our life go smooth! Happy programming.

6 comments:

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

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

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

    ReplyDelete
  4. Thank you! It saved me much of frustration!

    ReplyDelete
  5. Thank you... it works....

    ReplyDelete
  6. Restarting the Windows Management Instrument service does not work.

    Restarting Visual Studio is the only way that does work.

    ReplyDelete