When I am working with the new Visual Studio 2012 RC SharePoint Developer Tools I get the ‘Cannot connect to the targeted site’ error message if I try to connect to a local site that is using a host header.
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.
Do like this :registered the site URL in DNS (local DNS on development machine) then you’ll get this error. It seems that Visual Studio looks at the hosts file
(C:\Windows\system32\drivers\etc\hosts) for fully qualified names instead of DNS.
Once you add the site’s URL to the hosts file (either to 127.0.0.1 or the local IP of the development machine) all is good and Visual Studio will connect .
Hope this one helps!