I'm new to Sharepoint. I'm trying to create a simple webpart using Visual Studio 2010 but when I try to validate my Sharepoint Server (both VS 2010 and Sharepoint are present in two different system - the environment is FARM level deployment) it says:

Cannot connect to the SharePoint site: http://wpnne76648:2010. 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.

If I ignore this and click finish and then try to deploy the application it says:

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.

Note: I can open my web application in the browser.

  • Is the "real" url of your SharePoint web application localhost? It's more likely that you should use your servername instead of localhost Mar 20, 2012 at 11:32
  • Edited my question. It is the server name and not localhost. I tried using the later and then asked the question.
    – Amin Sayed
    Mar 20, 2012 at 11:35
  • Check out this post - netsourcecode.blogspot.com/2011/08/…, it may be helpful. Mar 20, 2012 at 11:58

3 Answers 3


It sounds like bad DNS resolution from Visual Studio, or bad user credentials.

So you have a web application at http://wpnne76648:2010, and wpnne76648 is the local name of your server? Do you have alternate access mappings in place for the FQDN also? If you open a browser on this server and point it to http://wpnne76648:2010 does the web application open?

There could be a number of things in the way. If this is a development environment, you can add a hosts file that points wpnne76648 to (localhost), which will force it to resolve locally as opposed to going out to DNS and resolving to the IP for the machine. I wouldn't do this for production, but it's a quick way to prove if your issues are DNS related in a development or lab environment.

The second piece is that as you quick deploy or deploy solutions from Visual Studio to the SharePoint server, Visual Studio needs the ability to access everything on the system and call for IISReset. Make sure the user account you're logged in while you're trying to do all of this is local admin. As a better practice to get into, do any solution development logged in as the setup/install account for the farm, as this account is local admin on all SharePoint boxes, unlike the farm account which should not be local admin on any of the boxes.

It's "possible" it's blowing up on the connection because it knows it doesn't have sufficient rights to do what it will ultimately need to (hence the IIS error).

This can also occur when you don't run VS as an admin.

  • Thanks. But is this due to permissions ? I checked the host file entry and there is nothing pointed out. I have requested to make me as SP Farm Administrator and sysadmin for the Content DB. Will this help ?
    – Amin Sayed
    Mar 20, 2012 at 13:04
  • What account are you logging onto the server with, and is that account a local administrator and farm administrator? You don't want to be a sysadmin on SQL, that may solve your problem, but it's a bad practice and your DBAs should push back on that (the sysadmin role gives you admin access to every database on the server). The Setup/Install account should have dbo on all SharePoint databases, and that is the account that you "should" use to do any feature deploy/upgrade operations. Never deploy solutions to a farm using personal credentials.
    – webdes03
    Mar 20, 2012 at 14:54
  • If you open a command prompt and run ping wpnne76648 what do you get back? I still think it's more likely to be a DNS issue. Can you post the server specs and configuration, it could also be the loopback check failing, or a firewall rule blocking access to your web application port, since it's a non-standard port. I would have expected the hosts file to be empty, my post was to add a hosts entry to force requests to to rule out a DNS issue. Did you try that?
    – webdes03
    Mar 20, 2012 at 14:58
  • Hi webdes03, the web application is opening fine, even ping works fine. I just checked. The web application to which I'm deploying this webpart is in another server (wpnne76648 - which is not my local machine) but is on the same farm where I have my development machine. I used the full path of that machine in Site URL property but it is throwing the error "Cannot connect to the Sharepoint Site. Make sure you have a valid URL....". How can we deploy this if the web app is in farm level ? I apologize for silly questions, but I'm learning SharePoint. Thanks
    – Amin Sayed
    Mar 21, 2012 at 12:06
  • What do you mean by it's another server, but on the same farm? Visual Studio cannot connect/deploy to a remote server. For development purposes Visual Studio and SharePoint must be on the same server. Use Visual Studio to package your solution into a solution package (WSP), and use PowerShell to deploy that WSP to the server locally. Visual Studio should never be installed on a production system, always use the WSP to deploy the solution to the environment.
    – webdes03
    Mar 21, 2012 at 13:22

Please make sure your application is running on 'Any CPU'. Having it set to x86 will prevent VS from connecting properly.

You can check this by opening the project menu and selecting ' Properties' and then navigate to the 'Build' tab. 'Platform target:' is where you will see the option, and set it to Any CPU.


Sharepoint should run on same machine as vs for this type of deploy.

Your should be a local and farm admin.

User the local host URL.

Disable the loop back check : http://iedaddy.com/2009/04/sharepointdisable-loopback-check/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.