Error occurred in deployment step ‘Activate Features': Attempted to perform an unauthorized operation

Having this error was so annoying since I tried to google it but no step-by-step instructions how to fix it. Anyway, I had this error while trying to deploy the visual web part for Sharepoint 2010 within VS 2010. There are at least 2 reasons why you’re getting this error:

  1. Bear in mind that you can only deploy the solution of the visual web part at a farm level. You will get this error while trying to deploy the solution at a site level. This is related to the correct site url you enter while creating the project. It is recommended that you always click on “Validate”.
  2. It is so obvious from the message that your windows login does not have the right “site collection” permission.

What I’m going to talk about and step through is point #2 (not having the right permission). Reason being is whichever the windows login that you’re using to deploy the solution, Sharepoint will use it to check if you’re authorised to deploy any solutions or not (not just deploying actually).

Step 1

Fire up the Sharepoint 2010 Central Administration.

Step 2

Go to Application Management –> Change site collection administrations

Step 3

Select the correct site collection and type your windows account as the secondary site collection administrator

Now try to deploy the solution again and it should work! :)

16 thoughts on “Error occurred in deployment step ‘Activate Features': Attempted to perform an unauthorized operation

  1. In my case the problem was that the Site URL in project properties was set incorrectly. Try to check it out.

    best,

    P.

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