I am trying to test developing for SharePoint 2010 on a Windows 7 machine.

I created a new empty SharePoint project, added a web part and deployed, which worked fine.

When I try to run or deploy a second time I get the above error message.

Anyone know how to fix this problem?

4 Answers 4


Apparently, VS 2010 uses WMI to control IIS during a redeploy. Without the features enabled, I got the same "Invalid namespace" error.

The solution was to: open the Turn Windows Features on or off menu in the Control Panel (under Programs), and enable WMI compatibility. The path to the feature is:

Internet Information Services -> Web Management Tools -> IIS 6 Management Compatibility -> IIS 6 WMI Compatibility

enter image description here

  • It helped me resolve the problem, but in windows server 2012 R2 , need to activate this feature in IIS by adding this feature in Add roles and Features Wizard. Apr 25, 2017 at 9:48
  • 1
    Thanks for this. This is still relevant in Windows Server 2016!
    – Memphis335
    Nov 19, 2018 at 18:48
  • 2
    This happens with me in SharePoint server 2019 over Windows server 2016 . Enable this feature solves the issue. May 2, 2019 at 13:19
  • 1
    You can turn on the feature via PowerShell as well: Add-WindowsFeature Web-WMI
    – pholpar
    Feb 10, 2020 at 8:51
  • 1
    Same here with SharePoint Server 2019 on Windows Server 2019
    – Ariwibawa
    Feb 16, 2023 at 10:37

Same problem with VS2019 and Windows Server 2019.

In modern Windows here's the solution:

enter image description here

  • This is actually the accepted solution but in modern windows' way
    – Maurizio
    Aug 30, 2019 at 16:38

Had the same issue on a Windows Vista x64 environment with Visual Studio 2010 RTM and SharePoint Foundation 2010 RTM.

Need to start the SharePoint Administration service (set to manual startup by default).

Go to:

  1. Start
  2. Run
  3. Services.msc
  4. SharePoint 2010 Administration
  5. Right click -> Start

This solved the issue for me.


Usually this problem comes when the server is too busy and not getting enough time to retract the Solution package file. What RaM are you using? Try to close all other application and deploy. If you still have problems let me know. I have solved the problem the same way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.