Error occurred in deployment step ‘Activate Features’: Operation is not valid due to the current state of the object.


Whenever you get this error

Error occurred in deployment step ‘Activate Features’: Operation is not valid due to the current state of the object.

Deploying a feature through Visual Studio 2010 kill the vssphost4.exe process first…

image

Advertisements

Tags: , ,

31 Comments on “Error occurred in deployment step ‘Activate Features’: Operation is not valid due to the current state of the object.”

  1. Priyanka August 16, 2010 at 6:39 pm #

    Hi,

    I’m getting the same error.
    I did not understand the solution.Can you please elaborate how the issue was fixed?
    Thanks.

  2. atulchhoda August 16, 2010 at 8:03 pm #

    If you are getting the same error , go to the Task Manager and look for all the instances of the process vssphost4.exe and kill them. I know this was not verbose and I will update the post.Let me know if it works for you.

  3. Firat August 27, 2010 at 7:12 am #

    This is not works for me.

  4. Mark September 21, 2010 at 1:48 pm #

    This does not work for me. Is there something else that I should be doing?

    • atulchhoda September 30, 2010 at 4:39 pm #

      Mark,

      Please do an IISRESET after you close all the visual Studio instances. Also try to kill w3wp.exe instances from Task Manager.

      -A

      • DebSourav February 18, 2014 at 10:05 am #

        Great suggestion..Thanks a lot……

  5. Mario September 30, 2010 at 4:13 pm #

    Hey!..Thank you very much…Ive been strugling with this for hours..worked like a charm

  6. lorenzo October 12, 2010 at 11:20 am #

    Thanks mate! You saved my day!

  7. Lizma October 19, 2010 at 12:11 pm #

    I had the same problem but mine was because the Class tag in the Elements.xml was wrong.

    • test September 27, 2011 at 4:11 am #

      Thanks a lot.

    • Rahul February 21, 2012 at 8:54 am #

      same problem, but solved by Lizma answer

  8. Ronan October 27, 2010 at 11:30 am #

    Lizma, I had the same problem and the issue was the class tag in elements.xml. booya.
    Thanks a lot.

    • Virender February 9, 2012 at 10:45 am #

      This Worked for me.. Thanks 🙂

  9. hans November 22, 2010 at 4:49 pm #

    like a slap on the forehead. thanks lizma. i had completely forgotten about the xml file.

  10. Vijay December 14, 2010 at 7:45 pm #

    In my case it got resolved after refering the appropriate assemble names in the Elements.xml file.

    check the assemble name in Elements.xml

  11. Caroline January 5, 2011 at 2:50 pm #

    I had the same problem, but it was caused by the fact that I hadn’t included the assembly in the package.

  12. Kamoshika February 28, 2011 at 1:03 am #

    Thanks to Lizma, got mine fixed. I removed the ItemUpdate from the receiver class as well as changed the namespace, so the elements.xml was out of sync. It would be nice if VS updated that…

    • someone September 22, 2011 at 1:30 pm #

      It works for me too.

      That was because I renamed the namespace from an event receiver.

      Thanks for the tip.

  13. Richard Weston (@rixabix) September 8, 2011 at 11:35 am #

    Works brilliantly – thank you for sharing!

  14. Dan Gleeballs January 27, 2012 at 10:46 am #

    This is a top-notch error provided by the SharePoint developers for when a feature won’t deploy, which translated means

    “ho ho ho, one of the billion possible settings for this feature isnt quite what we expeted, now, go off and waste your day or maybe even your week finding the solution.”

  15. TeTeo April 5, 2012 at 5:23 am #

    Brilliant! Works for me too 🙂

  16. hardik June 13, 2012 at 12:57 am #

    doesnt work for me

  17. Deepak June 28, 2012 at 12:05 pm #

    Thanks a lot Atul Chhoda … killed vssphost4.exe worked for me …!

  18. shripatinirmal February 21, 2013 at 12:44 am #

    It works …

  19. Johan February 26, 2013 at 4:17 pm #

    Nothing works for me… help!

    • Dave March 27, 2013 at 3:04 am #

      Sometimes you need to use PowerShell instead to force it to activate.

      Enable-SPFeature –identity “MyCustom” -URL http://somesite -force

  20. Mads Jensen June 12, 2013 at 6:06 am #

    Worked for me.. awesome:)

  21. Mikel July 24, 2013 at 6:28 pm #

    Incredible. It actually worked! thanks

  22. Aslam November 26, 2013 at 8:20 pm #

    Great this works

  23. sethuraja December 24, 2013 at 5:12 am #

    Pls ensure the valid and proper class Name in Elements.xml file it works after changing the class name

    sethuraja

  24. Lupeerion October 15, 2014 at 3:53 am #

    It finally worked for me. After I had closed the vssphost and resetted IIS I had to retract the solution Before deploying.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: