Forum Discussion
'appcmd.exe' exited with code '1168' - release error
May try this:
1. Verify the Site Exists
On the failing server:
• Open Command Prompt as Administrator.
• Run:
%windir%\system32\inetsrv\appcmd list site
• Confirm that the site name matches exactly what your pipeline is referencing.
If it’s missing, you’ll need to create it manually or adjust your pipeline to skip that server.
2. Check for Typos or Case Sensitivity
• IIS site names are case-sensitive in some contexts.
• Make sure the name in your pipeline task matches the actual site name exactly.
3. Inspect the IIS Configuration
• Open IIS Manager on the failing server.
• Look for the site manually.
• If it’s there, try stopping and starting it to confirm it’s responsive.
4. Agent Permissions
• Ensure the Azure DevOps agent running on that server has admin rights.
• It needs permission to run appcmd.exe and manage IIS.
5. Use a Conditional Task or Script
If the site might not exist on all servers, consider using a PowerShell script with a conditional check:
$siteName = "YourSiteName"
$site = Get-WebSite -Name $siteName -ErrorAction SilentlyContinue
if ($site) {
# Proceed with deployment
} else {
Write-Host "Site $siteName not found. Skipping..."
}