I have written some code in my feature receivers on feature activation and deactivation for my SharePoint 2010 site.

Basically some contents are added on feature activation and same are deleted when the feature is de-activated.

I install my solution using a PowerShell script. It runs OK for installation but when I run uninstall script I get an error message while de activating the features "The security validation for this page is invalid. Click back button of your browser, refresh the page and try again your operation". Though the un-installation does its job. Please help me to find out the cause of this error.

  • Have you checked ULS? And have you tried debugging? (I think you have to disable "Active Deployment Configuration" - yes even for deactivating)
    – eirikb
    Commented Sep 28, 2012 at 9:39
  • I am not sure what exactly "Active Deployment Configuration" is. Can you please explain a bit and how it address the problem?
    – V.B
    Commented Sep 28, 2012 at 9:51
  • It's a property in Visual Studio when you select your SharePoint project
    – eirikb
    Commented Sep 28, 2012 at 9:59
  • Ok I see this. As much as I got from this property is it about defining the order of the steps. As of now I am using "Default" configuration.
    – V.B
    Commented Sep 28, 2012 at 10:19
  • If you set it to "No activation" your feature will simply not be activated automatically on deploy. Without this debugging will never hit your breakpoints or fire on exceptions. And as far as I know this also applies to deactivating
    – eirikb
    Commented Sep 28, 2012 at 10:21

1 Answer 1


I resolved this issue by allowing for unsafe updates on my feature activation code.Now there is no error.

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.