0
votes

I'm trying to debug my application but any URLs which contain localhost (I've tried IIS Express, Local IIS, a simple Node server, and a Python development server) are redirected to the IIS welcome screen.

Examples:

localhost:xxxx/MyController

localhost:xxxx/SomeFolder/SomeFile.html

localhost/MyApp/MyController

localhost/MyApp/SomeFolder/SomeFile.html

The URL changes from the full url to my external IP address (i.e., URL changes from localhost:xxxx/MyController to simply XX.XX.XX.XX)

I just tried launching with a brand new ASP.NET "Empty Web Site," just loading the index.html file, and same situation.

There are no entries in my hosts file and it appears that this is only happening in Chrome. Any ideas?

2
Have you tried disabling local iis? - Vsevolod Goloviznin
I haven't, but I will... that said, that shouldn't be the issue; it never was in the past. - Tom
I'm just saying if it helps, have you tried resetting Chrome? - Hosein
@Hosein, how do you mean? I've tried clearing the cache and history -- is there a more robust way (other than reinstall...which I haven't tried, but perhaps should) - Tom
@Tom, You can delete the "C:\Users\<UserName>\AppData\Local\Google\Chrome\User Data\Default" folder and it will be like you've reinstalled Google Chrome. - Hosein

2 Answers

0
votes

This works in php, so it may help you with ASP:

  1. Run Notepad as administrator
  2. Open C:\Windows\System32\drivers\etc\hosts file
  3. add the following line to hosts file

    127.0.0.1:123 yourserver.com

  4. Save

  5. Run command prompt using CMD in run or type it in start menu
  6. Type this command and hit enter

    ipconfig /flushdns

  7. Close

  8. go to yourserver.com

I hope this help you. Again, this works fine with PHP.

0
votes

It sounds like your DNS is resolving the localhost hostname. If you're using your ISP's DNS, this may happen. You could change the DNS to Google's Public DNS. By pointing the DNS server to IP's 8.8.8.8 and 8.8.4.4. See the link for details on how to configure your computer.