In my new SharePoint 2010 book, I touch base on variety of deployment approaches; in this article I wanted to focus on Visual Studio 2010 feature allowing to deploy SharePoint 2010 solutions right to the portal. However, you haven’t configured your development environment properly – you will run into issues. Here I’m talking about the following error:
Error occurred in deployment step ‘Recycle IIS Application Pool’: The local SharePoint server is not available. Check that the server is running and connected to the SharePoint .
Error occurred in deployment step ‘Recycle IIS Application Pool’: Cannot connect to the SharePoint site: http://localhost/. Make sure that this is a valid URL 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
Visual studio uses the following process to deploy your solution: vssphost4.exe
Open your task manager and find the process in the list; take a note of the User Name under which this process is running, let’s say it’s myadmin_account
Now, open your SQL Management Studio and ensure this Username is added as a DBOWNER to the following databases:
SharePoint_AdminContent_[guid] SharePoint Site Content DB
Close and Open your Visual Studio again, this will ensure the service is recycled; this should fix above deployment error. If you’re still having same issue, End the process in taskmanager and then VS 2010.