One of the common deployment errors is Error Occurred In Deployment Step ‘Recycle IIS Application Pool’ – Invalid Namespace SharePoint. It occurs if the developers are trying to deploy SharePoint solution to SharePoint 2019 on premises.
The solution: you need to install IIS 6 management backward compatibility.
The steps (windows server):
- serer manager
- Click on “Add Roles and Feature”
- Click next in the appeared dialog until you reach “Server Roles”.
- expand “Web Server (IIS)” and then expand “Management Tools”
- from “IIS 6 Management Compatibility” select “IIS 6 WMI Compatibility”, “IIS 6 Metabase Compatibility” & “IIS 6 Management Console” and click Next.
- Click install