Building custom solutions for SharePoint is something that no SharePoint site can not have. Developing custom features, web parts, event receivers and many other tools has became so important when the out-of-the-box SharePoint features become limited against the site requirements.
This post illustrates a widely faced issue when trying to add a new user to the farm and this user tries to deploy any custom solution to a SharePoint 2010 site using Visual Studio 2010. When this user tries to deploy the project, an error shows up with message: "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 farm."
To fix this error you need to give some permissions to the failed user on both the server and the database level. Follow these steps to fix this issue.
Server level permissions
- Add the user to the Administrators group. If the user is not an administrator, then add him.
- Add the user to the SharePoint farm administrators group. To do this, go to central administration, and under the "Security" section click "Manage the farm administrators group". On the "Farm Administrators" group page, click "New" and add the user.
- Add the user to site collection administrators. To do this, browse to the SharePoint site that you need to deploy the solution on. Click "Site Actions" then click on "Site Settings". Under "Users and permissions" section click "Site Collection Administrators". On the "Site Collection Administrators" page, put the new user in the users look up box, click "Check Names" and then click "OK".
- Add the user to the same farm administrator groups. Add the user to the following groups: IIS_IUSRS, WSS_ADMIN_WPG, WSS_RESTRICTED_WPG_V4 and WSS_WPG.
Database level permissions
- The new user should be given dbowner permission on the SharePoint configuration database.
- The new user should be given dbowner permission on the SharePoint administrator database.
After you finish applying the above configurations, do an "iisreset" from the command prompt and try to redeploy the project from Visual Studio 2010.