Issue:
Started to learn how to use c# and asp.net and thought I would start to teach myself how to develop new apps for SharePoint 2013. Turns out after getting SP2013 and Visual Studio 2012 all setup in my dev environment I couldn’t get Visual Studio to connect to SharePoint. After naming my project and trying to specify the site to deploy my project to I would get 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.
Solution:
Turns out, Visual Studio will only connect to SharePoint if the physical address of the machine is returned instead of 127.0.0.1. To overcome this issue I added an entry into my hosts file “C:WindowsSystem32driversetchosts” that had my machines physical address and Visual Studio had no problems connecting after that.