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:
- 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”.

- 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!



Thanks a lot …….problem solved……..
Its not working for me.
Giving same error.
Kindly assist me to solve this.
try reseting the application pool..
In my case the problem was that the Site URL in project properties was set incorrectly. Try to check it out.
best,
P.
Greate article.. resolved my issue in minutes.. even I am newbee here, I am able to follow.. Thanks from my heart
Worked for me, thanks.
Worked for me Great article thanks a lot saved my day
Thanks a lot…..it worked….
How did you find this solution? But great article !
thanks working
Helped much..thanks