Problem/Issue:
Recently, while developing a custom visual web part for SharePoint 2019 On-Premise version, I was facing below error on deployment of the solution:
"Error occurred in deployment step 'Recycle IIS Application Pool': Invalid namespace"
Analysis & findings:
In Past, we'd already faced such issue and it was related to .NET Framework. So, I tried with reducing current version to 4.5 framework but it didn't help much.
In Past, we'd already faced such issue and it was related to .NET Framework. So, I tried with reducing current version to 4.5 framework but it didn't help much.
Then, I did bit googling, and spent more time to analyze the the issue further. And finally, I was able to find the root cause of the issue. It was related to changes in configuration of development environment.
Solution:
We need to add "IIS 6 WMI Compatibility" feature in our development machine to fix the issue. To add it, we need to follow below steps:
We need to add "IIS 6 WMI Compatibility" feature in our development machine to fix the issue. To add it, we need to follow below steps:
- If you are using windows server, go to server manager.
- Click on “Add Roles and Feature”.
- It will open “add feature” dialog. Click next till you reach “Server Roles”.
- Expand “Web Server (IIS)”
- Expand “Management Tools”
- Expand “IIS 6 Management Compatibility”
- Now, check “IIS 6 WMI Compatibility”, “IIS 6 Metabase Compatibility” & “IIS 6 Management Console” and click Next.
Note - In my case, the first two features were already installed. If it is not installed in your machine, please select it as well.
- Click Next and move to feature tab.
- Click Install in confirmation installation screen.
- It will start installing the feature. Wait for the completion.
- Click close.
- Restart the visual studio and try to deploy the project and it will deploy successfully.
If you have any questions you can reach out our SharePoint Consulting team here.























