Cannot connect to the targeted site

04/03/2015 09:06

Visual Studio error when setting Site Url for Sharepoint project


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.


or


Property value is not valid. Remote SharePoint site connections are not supported.

It could happen when your site url is host header site, so it's needed to add host header to hosts file.

e.g

127.0.0.1 myhostheadersitecollection

Detailed info in http://blog.mastykarz.nl/cannot-connect-to-the-targeted-site-error-visual-studio-2012-rc-sharepoint-developer-tools-host-headers/