Recycle IIS Application pool: The local SharePoint server is not available

In this SharePoint tutorial, I would like to discuss one of the SharePoint solution deployment issue using visual studio 2015/2017. The error comes as Error occurred in deployment step ‘recycle iis application pool’: the local SharePoint server is not available. Check that the server is running and connected to the SharePoint farm.

As part of my daily development, I was trying to deploy my SharePoint FARM solution using Visual Studio. While deploying the solution I got the error as “Error occurred in deployment step ‘recycle IIS application pool’: the local SharePoint server is not available. Check that the server is running and connected to the SharePoint farm”.

Recycle IIS Application pool: The local SharePoint server is not available

Recycle IIS Application pool: The local SharePoint server is not available

When I investigate further on this issue, I realized that the web application is not running in IIS. As part windows server OS regular updates IT team rebooted the server but some of the web applications were not started.

Follow the below steps to fix this issue:

  • Open the IIS (Internet Information Services) (Click on Windows + R -> inetmgr)
  • Identify the particular SharePoint web application
  • Right-click on the SharePoint web application and start it

This resolved my issue and I was able to deploy the solution seamlessly.

IISReset in all the servers in a SharePoint Farm

Below is the PowerShell script to do IISReset in all the servers in a SharePoint 2013/2016/2019 Farm.

# This Scrip allows to do an IIS RESET to all the servers in a SharePoint Farm
# requited parameters: N/A
##########################################################
If ((Get-PSSnapIn -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
{ Add-PSSnapIn -Name Microsoft.SharePoint.PowerShell }
$host.Runspace.ThreadOptions = “ReuseThread”
#Definition of the funcion that performs the IIS RESET in all the servers
function Do-IISReset
{
try
{
#Getting the servers where the IISReset is going to be done
$spServers= Get-SPServer | ? {$_.Role -eq “Application”}
foreach ($spServer in $spServers)
{
Write-Host “Doing IIS Reset in server $spServer” -f blue
iisreset $spServer /noforce “\\”$_.Address
iisreset $spServer /status “\\”$_.Address
}
Write-Host “IIS Reset completed successfully!!” -f blue
}

catch [System.Exception]
{
write-host -f red $_.Exception.ToString()
}
}
Start-SPAssignment –Global

#Calling the function
Do-IISReset
Stop-SPAssignment –Global
Remove-PSSnapin Microsoft.SharePoint.PowerShell

You may like the following SharePoint 2013 tutorials:

In this SharePoint tutorial we learned, how to solve Recycle IIS Application pool: The local SharePoint server is not available.

  • This not resolved my issue. I have to Deploy WSP several times and try to attach the process and it allow me to debug then.

  • >