Wednesday, November 11, 2015

Error Type: The name ‘InitializeControl’ does not exist in the current context

Hi, 

Today i want to explain how to resolve "The name ‘InitializeControl’ does not exist in the current context" error.

This error ever common when you try to build SharePoint solution from visual studio 2010/2013.

This error mainly comes when you do not have access to connect SharePoint site.

To confirm this, Try to create new SharePoint solution from visual studio, give site URL where you want to debug and click on connect. Then you will get the below error.

The local SharePoint server is not available. Check that the server is running and connected to the SharePoint farm.


It means that you do not have access to connect to SharePoint server from visual studio.

To resolve the above two issues  you should have content database access of config database and the web application.

Now, Go to SharePoint powershell management and execute the below script/queries

Add-SPShellAdmin -UserName <domain\username>

--This will add permissions to the config database in SharePoint 2010

$db = Get-SPContentDatabase -WebApplication <web application URL>

Add-SPShellAdmin -UserName <domain\username> -database $db.Id

Replace "<domain\username>" with the user who is going to work and <web application URL> with the web application.

Now you can happily start working on :).

No comments:

Post a Comment