0

I am stucked on this error:

Operation is not valid due to the current state of the object

while tryng to enable a feature (site scoped) with Enable-SPFeature powershell command.
I tried to iisreset (with killing w3p processes) and I checked that the <Class> in the Element.xml is correct (with the namespace and class).

I have this issue just on prod environment, I can enable the feature on dev farm.

3
  • If you are activating through powershell and has a feature receiver, try to restart the timer service and then try again Commented Apr 22, 2015 at 19:07
  • is iisreset not enough?
    – Nk SP
    Commented Apr 22, 2015 at 19:19
  • Not if you activate through powershell, then it will not be run in the w3wp process. So, reset timer service and restart your powershell could possibly solve it Commented Apr 22, 2015 at 19:27

2 Answers 2

1

In my solution I had a event receiver and some content type definition.
I splitted it in two different solutions (one with event receiver and other with definitions) and now it is working.

Actually I do not know why (I did not change code at all), sad story.

0

Try with Enable-SPFeature xxx -Force

1
  • with -Force I get no error but the event receiver in the feature is not working
    – Nk SP
    Commented Apr 22, 2015 at 14:55

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.