I was working on a SP2010 project and working from a box I did not build, and I was getting the following error when trying to deploy my solution:
Error occurred in deployment step ‘Recycle IIS Application Pool’: Cannot connect to the SharePoint site: http://xxx/. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project
I thought, That’s odd I am pretty sure I am a local admin.
Double checked, sure enough I was, I should be able to do an IISreset.
So I pulled up a command line and was in fact able to successfully run an IISreset. But still was getting this error from VS.
I saw some threads that indicated I may need to also be a site collection Admin in order to do the IISreset from VS during a deploy. So I checked, I was a site collection admin, but still was getting the error from a VS deploy.
For fun I thought lets close and restart Visual Studio, no help. Restart the box, no help.
Did a little more digging and came across this thread.
http://mushannak.blogspot.com/2013/02/error-occurred-in-deployment-step.html
That was it, the local DB did not have my account as the owner on the content database.
Changed that and I was able to successfully deploy, no thanks to that error message though.