6

I was changing OAuth/Owin settings and Azure publish settings in a Web Application project this morning, but soon after we decided deployment will be to a specific IIS Azure VM (now visible across our local domain). All code/setting changes have been reverted.

At one point I also changed the drivers\etc\hosts file to allow a dummy name for Microsoft OAuth, but that has been reverted.

Notes:

  • My startup URL is http://localhost:22222/
  • I am running under IIS Express (as my local Dev VM will not allow me to install full IIS)
  • When I start the Web Application with IE I simply get "This page can't be displayed"
  • If I start it with Chrome I get "This webpage is not available", but it also changes the browser URL to https://localhost (note the s, i.e. using SSL).
  • I have pulled the project down fresh from source control. No change.
  • The project is under TFS source control.
  • Another developer on the same project has the latest files and it works fine.
  • If I run any other Web Application project, they work just fine.
  • All OWIN registration of providers has been commented out. No change.
  • Deleted the entire project folder and pulled fresh from TFS. No change. This probably means a local machine setting somewhere is the cause?

What could I have damaged in my Web Application to cause this problem? I have been scratching my head for hours now and nothing we try is working. The application simply will not start in any browser.

Project Web Settings tab:

enter image description here

iCollect.it Ltd
  • 92,391
  • 25
  • 181
  • 202
  • Show the screenshot of `Project` => `Properties` => `Web` tab. This probably will explain a lot. – trailmax Jan 28 '15 at 16:39
  • @trailmax: Added (did not help us, but please do take a look or request further info). Thanks – iCollect.it Ltd Jan 28 '15 at 16:43
  • When you re-downloaded your source from TFS, did you remove all user settings files? Get the source into another folder and try running there... – trailmax Jan 28 '15 at 16:49
  • @trailmax: This is a "really big" project, with dozens of libraries. Pulling it down on the same machine won't work with TFS as it is already mapped. We already know if I pull it down on a new machine it will work. Where are the user settings stored? – iCollect.it Ltd Jan 28 '15 at 16:55
  • OK, don't have to pull down all the files. Shut down VS, remove all `*.user` files from the root folder. Open the solution again and try. Probably will not work - just guessing. – trailmax Jan 28 '15 at 16:57
  • @trailmax: removed *.user in the related project folder (also had a look in it and the contents just match the options shown in the Web Settings screen-shot). Still no luck. A new Web Project in the same solution works just fine :( – iCollect.it Ltd Jan 28 '15 at 17:35
  • That's strange. I'm out of options now. Hope somebody else will help... – trailmax Jan 28 '15 at 21:26
  • 1
    See my answer for partial solution. – BigJump Feb 05 '15 at 10:48
  • 1
    Did you guys solve this? I'm having same problem right now – Bogac Apr 24 '15 at 12:49

1 Answers1

10

Answer at bottom, given to this chromium issue [issue 444479] helped me:

Same here - I also believe caused by HSTS - see http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security

If you have (developed) any other localhost sites which send a HSTS header...

eg. Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

...then depending on the value of max-age, future requests to localhost will be required to be served over HTTPS.

To get around this, I did the following.

  • In the Chrome address bar type "chrome://net-internals/#hsts"
  • At the very bottom of a page is QUERY domain textbox - verify that localhost is known to the browser
  • If it is, DELETE the localhost domain using the textbox above
  • Your site should now work using plain old HTTP

HTH,

Jay

ps. This is not a permanent solution, but will at least get it working between projects. If anyone knows how to permanently exclude localhost from the HSTS list please let me know :)

Give it a try.

Bogac
  • 3,596
  • 6
  • 35
  • 58
  • 1
    Thanks, lost almost one hour before finding your answer :) – Dryadwoods May 26 '15 at 13:52
  • Thanks this is awesome. I lost a couple of hours because of this – orellabac Oct 07 '15 at 19:12
  • @Bogac - Any thought about [this](http://stackoverflow.com/q/34130579/2404470) please? – Zameer Ansari Dec 09 '15 at 16:01
  • Hi! I am also facing the same issue, tried above method but nothing works. localhost is not known to it still it is loading the site on https. – Bilal Amjad Jul 23 '16 at 10:13
  • Are you sure you are doing it right? There are 2 textboxes at the bottom in that settings page. One for Query and on top of that Delete. You need to type localhost in Delete Domain textbox and click Delete button. – Bogac Jul 24 '16 at 07:38