0
votes

I have SharePoint 2010 foundation and Visual Studio 2010 on my desktop. SharePoint Server 2010 is installed in a virtual machine in the server machine. I have added myself as administrator of the VM, added myself as farm administrator and provided DB Owner access to SharePoint Content DB. I need to create a SharePoint 2010 Empty SharePoint Project through VS 2010 and giving the url of the sharepoint server(virtual machine) in the box 'What local site do you want to use for debugging?'- 'http://serappsp/' and selected to deploy as a farm solution. When i click 'Validate' the error prompted is : 'Cannot connect to the SharePoint site: 'http://serappsp/'. Make sure that the Site URL is valid, that the SharePoint site is running on the local computer, and that the current user as the necessary permissions to access the site.'

3

3 Answers

0
votes

You are trying to make a Farm Solution where as your Visual Studio is on a different Machine. You need to install and work on Visual Studio on the same virtual machine where SharePoint is installed.

0
votes

Came across this question while investigating same issue. Error message suggests a site issue but resolved it by giving myself permissions to the SP__Content database in sql server.

0
votes

If you want to program for SharePoint from another machine, you must use Client Object Model. Try to instantiate the site like this:

string siteUrl = "http://MyServer/sites/MySiteCollection";

ClientContext clientContext = new ClientContext(siteUrl);
Web oWebsite = clientContext.Web;