Friday, June 01, 2012

Error while deploying package using Visual Studio 2010 to SharePoint 2010

Errors
Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permissions to access the database before trying again.

OR


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.


Reason

The error pops up when userid doesn't have access to configuration and content DB.

Resolution
There are 2 ways to resolving this issue.

Preferable Method(1st method): 
Use Power shell command to provide user id access to SharePoint DB's.

  • "Add-SPShellAdmin -UserName domain\username" This will add permissions to the config database in SharePoint 2010
  • "Get-SPContentDatabase -WebApplication " This will return information on the content database for the desired web application
  • "Add-SPShellAdmin -UserName domain\username -database " This will add permissions to the content database for the desired web application



2nd method:
Add the userid as DBOwner to Configuration and Content DB. Though this is not best practice but will at least get you going.

-Rags




3 comments:

sivanesanb said...

Great. works Perfectly.

sivanesanb said...

Works perfectly.

sivanesanb said...

Thanks. Works fine.