SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Have you checked ULS? And have you tried debugging? (I think you have to disable "Active Deployment Configuration" - yes even for deactivating) – eirikb Sep 28 '12 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 Sep 28 '12 at 9:51
It's a property in Visual Studio when you select your SharePoint project – eirikb Sep 28 '12 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 Sep 28 '12 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 Sep 28 '12 at 10:21
up vote 0 down vote accepted

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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