Compartilhar via


SharePoint 2013 : Cannot connect to the targeted site.

While creating a new development environment I ran into the following error:

Cannot connect to the targeted site. This error can occur if the specified site is not hosted on the local system. SharePoint solutions work only with locally-installed versions of SharePoint Foundation or SharePoint Server. Remote development is supported only for apps for SharePoint 2013.

Usually this error pops us if you did the following:

Edit host file

127.0.0.1                  urlofmywebapp

However, as my development machine is running in my own domain, my hostfile is empty and the site is accessed through the DNS. The fix is however the same. Adding the IP of the server to the host file did the trick.

10.0.0.100                urlofmywebapp

This is supposed to get fixed in a future version of the Office Developer tools.

Comments

  • Anonymous
    December 17, 2013
    use http://localhost:portno of ur site/   then click on validate....if validate successful then  deploy as farm solution

  • Anonymous
    January 10, 2014
    Updated my local host and worked for me too

  • Anonymous
    January 20, 2014
    Hello, I recently faced the same problem. I hope that this post will help you to resolve your problem. algrandi.azurewebsites.net/.../sharepoint-2013-cannot-connect-to-the-targeted-site

  • Anonymous
    November 05, 2014
    Thanks! This worked locally on VS2012 + Win Srv 2008

  • Anonymous
    November 27, 2014
    Thanks this worked wonderfully. It is however ridiculous that a bug like this exists at all. Pick up your game MS.

  • Anonymous
    April 04, 2015
    Sir it not working on my machine...can any one help me...as I m beginner

  • Anonymous
    November 12, 2015
    No, it does not work for my Office 365 SharePoint Online, still finding solution.

  • Anonymous
    November 15, 2015
    You should not have to do that for an Office 365 SharePoint site.