Sharepoint - Problem connecting Visual Studio 2013 to SharePoint 2013

first make sure that the account your using to open up vs2013 is the correct account! what you could do is open it up as admin:

To run Visual Studio with administrative permissions on Windows 8, Windows 8.1, Windows Server 2012, or Windows Server 2012 R2

1.On the Start screen, type Visual Studio. You should see the version or versions of Visual Studio you have installed.

2.Select the version of Visual Studio you want to start, and then bring up the shortcut menu (it appears at the bottom of the screen). Choose Run as administrator.

When Visual Studio starts, (Administrator) appears after the product name in the title bar.

To run Visual Studio with administrative permissions on Windows 7 or Windows Server 2008 R2

1.On the Start menu, choose All Programs.

2.In the Microsoft Visual Studio Version folder select Visual Studio Version open the shortcut menu, and then choose Run as administrator.

When Visual Studio starts, (Administrator) appears after the product name in the title bar.

http://msdn.microsoft.com/en-us/library/jj662724.aspx

if that fails which it shouldnt than you can:

Grant the 'sysadmin' server role to the development user account in SQL Server.

Members of the sysadmin fixed server role can perform any activity in the server.

http://msdn.microsoft.com/en-us/library/ms188659.aspx

Guidelines on granting SQL Server sysadmin privileges

http://support.microsoft.com/kb/2184138

the first solution should work as your running under admin account and it would already have sysadmin tied to it..... unless during install somthing happend! If you want to grant a user (different user account) to connect using vs than this method is fine but i wouldnt give sysadmin as its full access and only admin account / farm accounts should have that privlage! if you do than follow this guide!

http://technet.microsoft.com/en-us/library/hh377944.aspx

EDIT

just to make it clear! you cannot connect a normal project from your local machine to a sharepoint server! i think they removed that ability on 2013, also like to note that there is currently only the option of making apps on 2012 remotely that can connect to sharepoint for deployment!

as noted to create projects like webparts and so on you need to develop on a vm either hosted on the server or locally.... that vn has vs2012 that youll develop directly and depoly directly! when you want to run the project on the live server that is where you use the wsp and powershell!

http://msdn.microsoft.com/en-us/library/jj163785(v=office.15)


Add the account under which Visual Studio process is running to following DBs as dbowner -

  • SharePoint content DB
  • SharePoint central admin content DB
  • SharePoint configuration DB

After that you will be able to both deploy and debug from Visual Studio.

Reference - http://tech-turf.blogspot.com/2015/12/sharepoint-2013-problem-in-debugging.html