Remote SharePoint site connections are not supported.

When I do SharePoint development, I usually work with multiple web applications. One for My Site, one for publishing, one for search, etc. I also use host headers to identify each web application so that I don’ t have to remember different port numbers.

On my developer box, I add a number of entries to the hosts file that map each host name to 127.0.0.1. This has worked on all previous versions of SharePoint and Visual Studio, but stopped with the Beta version of the Visual Studio extensions for SharePoint 2013.

When trying to use http://col.sp15.dev as the Site Url

You end up with the following error message:

If I enter http://machinename, everything works as expected.

Why do I get this error message? Everything is running on my local machine. I only have one machine and all host names resolve to the loopback address.
Refusing to accept this limitation, I started exploring the extension code written by Microsoft.

When setting this property, the code makes a lot of checks. One of them is the IsLocalByIp(). The url being passed is the one you type in the property window.

If you copy this code to a console application and run it, it’s easy to discover why things are not working. The hostAddresses variable contains all the addresses of the computer except the 127.0.0.1 address. The second variable contains the 127.0.0.1 address specified in the hosts file. Since this is not considered a local address, the test fails.

Hopefully Microsoft will add an exception rule for 127.0.0.1 in this code. Until then, the solution is to use the IP address of your machine in the hosts file, not 127.0.0.1. If you have a dynamic IP address, remember to update the host file.

Advertisements

3 Responses to Remote SharePoint site connections are not supported.

  1. Thanks for the tip! This saved me a lot of time šŸ™‚

  2. another way to do it would be

    1 ) go to C:\Windows\System32\Drivers\etc

    open the hosts file and set the dynamic IP of your machine facing you site url

    example 10.120.54.182 momo.at.morocco

    2) save and try again

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: