19

I am working on a website which authenticates with Facebook, so that the user can sign in through his/her Facebook profile. I've seen similar questions like this one, but none that covers exactly my issue.

To test this Facebook authentication locally, I figured that some hacks were needed. You see, Facebook only allows redirects to certain domains after the authentication process. For these domains, localhost is not an option.

So I decided to do some research. I ended up changing my hosts file to point the domain local.fablelane.com to 127.0.0.1. However, now it complains when I try to change the virtual directory in Visual Studio 2012.

First, I see this dialog after changing it.

enter image description here

I then click Yes and end up with this dialog here.

enter image description here

What do you suggest I try? How can I change my virtual directory? It is important that I find a way to do this either programmatically, through changing a file somewhere, or through the commandline. The reason for this is that I intend to make an automatic setup program that does this for me in the future.

Mathias Lykkegaard Lorenzen
  • 15,031
  • 23
  • 100
  • 187

4 Answers4

23

You will need to uncheck Use IIS Express and also add your new name local.fablelane.com as a binding to IIS, so that when VS tries to open the site URL, the host-header matches the site.

Also, is there any reason you need a specific port, rather than the default? It should be fine with 80.

You haven't said which version of IIS you're using, but on 8, open IIS Admin, expand your machine-name, expand Sites, right-click on local.fablelane.com (or however you've named it), and select Edit bindings and add local.fablelane.com.

nicodemus13
  • 2,258
  • 2
  • 19
  • 31
  • 1
    I'd changed my Default App bindings and had `localhost` removed but forgot. I had to re-add it to get the Virtual Directory creation to work. Why can't the IIS developers just write decent error messages? – makhdumi Jan 22 '18 at 23:26
2

Try uncheck the option "Use IIS Express".

emgozzi
  • 37
  • 2
-2

Check if your website port number in IIS has been changed.If its changed edit bindings and change port number to 80

P.Ash
  • 1
  • 1
-4

In addition to the above, click on the override application root URL and paste the host name address which you have given in the Project Url.

It worked for me.

venu
  • 1
  • 1